xref: /aoo4110/main/basctl/source/basicide/objdlg.hxx (revision b1cdbd2c)
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 
44 public:
45 			ObjectTreeListBox( Window* pParent, const ResId& rRes );
46 			~ObjectTreeListBox();
47 };
48 
49 class ObjectCatalogToolBox_Impl: public ToolBox
50 {
51 public:
52     ObjectCatalogToolBox_Impl(Window * pParent, ResId const & rResId,
53                               ResId const & rImagesHighContrastId);
54 
55 private:
56     virtual void DataChanged(DataChangedEvent const & rDCEvt);
57 
58     void setImages();
59 
60     ImageList m_aImagesNormal;
61     ImageList m_aImagesHighContrast;
62     bool m_bHighContrast;
63 };
64 
65 class ObjectCatalog : public FloatingWindow
66 {
67 private:
68 	ObjectTreeListBox	aMacroTreeList;
69     ObjectCatalogToolBox_Impl aToolBox;
70 	FixedText			aMacroDescr;
71 	Link				aCancelHdl;
72 
73 protected:
74 	DECL_LINK( ToolBoxHdl, ToolBox* );
75 	void				CheckButtons();
76 	DECL_LINK( TreeListHighlightHdl, SvTreeListBox * );
77 	void				UpdateFields();
78 	virtual void		Move();
79 	virtual sal_Bool		Close();
80 	virtual void		Resize();
81 
82 public:
83 	ObjectCatalog( Window * pParent );
84 	virtual ~ObjectCatalog();
85 
86 	void				UpdateEntries();
87     void                SetCurrentEntry( BasicEntryDescriptor& rDesc );
88 
SetCancelHdl(const Link & rLink)89 	void				SetCancelHdl( const Link& rLink ) { aCancelHdl = rLink; }
90 };
91 
92 #endif	//_OBJDLG_HXX
93 
94