xref: /aoo42x/main/basctl/source/basicide/objdlg.hxx (revision d67f091b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _OBJDLG_HXX
25 #define _OBJDLG_HXX
26 
27 #include <svheader.hxx>
28 #include <vcl/floatwin.hxx>
29 #include <vcl/toolbox.hxx>
30 #include <vcl/fixed.hxx>
31 #include "vcl/image.hxx"
32 
33 #include <bastype2.hxx>
34 
35 class StarBASIC;
36 
37 class ObjectTreeListBox : public BasicTreeListBox
38 {
39 private:
40 
41 	virtual void	Command( const CommandEvent& rCEvt );
42 	virtual void	MouseButtonDown( const MouseEvent& rMEvt );
43 	virtual void	KeyInput( const KeyEvent& rEvt );
44 
45 	bool			OpenCurrent();
46 public:
47 			ObjectTreeListBox( Window* pParent, const ResId& rRes );
48 			~ObjectTreeListBox();
49 };
50 
51 class ObjectCatalogToolBox_Impl: public ToolBox
52 {
53 public:
54     ObjectCatalogToolBox_Impl(Window * pParent, ResId const & rResId,
55                               ResId const & rImagesHighContrastId);
56 
57 private:
58     virtual void DataChanged(DataChangedEvent const & rDCEvt);
59 
60     void setImages();
61 
62     ImageList m_aImagesNormal;
63     ImageList m_aImagesHighContrast;
64     bool m_bHighContrast;
65 };
66 
67 class ObjectCatalog : public FloatingWindow
68 {
69 private:
70 	ObjectTreeListBox	aMacroTreeList;
71     ObjectCatalogToolBox_Impl aToolBox;
72 	FixedText			aMacroDescr;
73 	Link				aCancelHdl;
74 
75 protected:
76 	DECL_LINK( ToolBoxHdl, ToolBox* );
77 	void				CheckButtons();
78 	DECL_LINK( TreeListHighlightHdl, SvTreeListBox * );
79 	void				UpdateFields();
80 	virtual void		Move();
81 	virtual sal_Bool		Close();
82 	virtual void		Resize();
83 
84 public:
85 	ObjectCatalog( Window * pParent );
86 	virtual ~ObjectCatalog();
87 
88 	void				UpdateEntries();
89     void                SetCurrentEntry( BasicEntryDescriptor& rDesc );
90 
SetCancelHdl(const Link & rLink)91 	void				SetCancelHdl( const Link& rLink ) { aCancelHdl = rLink; }
92 };
93 
94 #endif	//_OBJDLG_HXX
95 
96