1 -- Created on: 1996-01-29
2 -- Created by: PLOTNIKOV Eugeny
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class IconBox from WNT inherits Window from WNT
25 ---Purpose: This class defines a Windows NT icon box
30 GraphicDevice from WNT,
36 NameOfColor from Quantity
40 WindowDefinitionError from Aspect,
41 WindowError from Aspect
46 aDevice : GraphicDevice from WNT;
47 aName : CString from Standard;
48 aStyle : Dword from WNT = 0;
49 Xc : Real from Standard = 0.5;
50 Yc : Real from Standard = 0.5;
51 aBkColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY
53 returns mutable IconBox from WNT
55 ---Purpose: Creates an IconBox defined by his Center in DSU.
56 -- ALL Icons are loaded from the Icon File Directory Name:
57 -- "[$SYMBOL]xxxxxxx[.ifd]"
58 -- Warning: Raises if the Position is out of the Screen Space
59 -- or the Icon File Directory Name don't exist
60 raises WindowDefinitionError from Aspect;
63 ---------------------------------------------------
64 -- Category: Methods to modify the class definition
65 ---------------------------------------------------
68 LoadIcons ( me : mutable; Name : CString from Standard )
69 returns Integer from Standard is static;
71 ---Purpose: Loads Icon Box from an Other Icon File Directory Name
72 -- and returns the loaded icons number.
73 -- Warning: The Icons previously loaded are NOT cleared.
75 Show ( me ) is static;
77 ---Purpose: Shows Icon Box to the screen
78 -- Warning: The Icon Box is displayed at the centered position
79 -- specified at the creation time and the size depend
80 -- of the Icon number really loaded inside.
84 Name : CString from Standard
86 returns Integer from Standard is static;
88 ---Purpose: Unloads All previously loaded Icons in the IconBox
89 -- and returns the unloaded icons number.
91 Destroy ( me : mutable ) is redefined;
93 ---Purpose: Destroies the IconBox
99 Name : CString from Standard;
100 aWidth : Integer from Standard = 0;
101 aHeight : Integer from Standard = 0
104 ---Purpose: Adds an Icon of Size aWidth,aHeight given in PIXEL
105 -- to the Icon Box from a FULL Existing Window
106 -- NOTE that if aWidth or aHeight is 0 the default icon size is taken.
108 SaveIcons ( me ) returns Integer from Standard is static;
110 ---Purpose: Save all new created Icons as iconname.xwd file in the user
111 -- directory and returns the saved icons number.
115 aWidth : Integer from Standard;
116 aHeight : Integer from Standard
119 ---Purpose: Sets dimensions for icons which are visible in the box.
121 ----------------------------
122 -- Category: Inquire methods
123 ----------------------------
127 returns Integer from Standard is static;
129 ---Purpose: Returns the Number of Icons loaded in the Icon Box.
131 IconName ( me; Index : Integer from Standard )
132 returns CString from Standard
134 ---Purpose: Returns the Name of the N ime Icon
135 -- Warning: Raises if Index if out of range depending of the
136 -- Number of Loaded Icons.
137 raises WindowError from Aspect is static;
141 Name : CString from Standard;
142 Width, Height : out Integer from Standard
144 returns Boolean from Standard is static;
146 ---Purpose: Returns the Pixmap Size attached to the Icon Name
147 -- Warning: May return FALSE if Icon doesn't exist in the IconBox.
148 ---Category: Inquire methods
150 IconPixmap ( me; Name : CString from Standard )
151 returns Handle from Aspect is static;
153 ---Purpose: Returns the Pixmap attached to the Icon Name
154 -- Warning: May return 0 if Icon doesn't exist in the IconBox.
158 Name : CString from Standard;
159 Width : Integer from Standard;
160 Height : Integer from Standard
161 ) returns Handle from Aspect is static;
163 ---Purpose: Returns the Centered part of the Pixmap of required Size
164 -- attached to the Icon Name
165 -- Warning: May return 0 if Icon doesn't exist in the IconBox.
169 hwnd : Handle from Aspect;
170 uMsg : Uint from WNT;
171 wParam : Dword from WNT;
172 lParam : Dword from WNT
174 returns Long from WNT is static;
176 ---Purpose: routine to process events sent to the icon box
179 myIconWidth : Integer from Standard is protected;
180 myIconHeight : Integer from Standard is protected;
181 myFont : Handle from Aspect is protected;
182 myPen : Handle from Aspect is protected;
184 -- fields for event management
186 myDragging : Boolean from Standard is protected;
193 myMaxPos : Integer from Standard is protected;