Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Excel add in development in C++ Aplications in finance - Dalton S.

Dalton S. Excel add in development in C++ Aplications in finance - Wiley publishing , 2005. - 425 p.
ISBN 0-470-02469-0
Download (direct link): exceladdindevelopmentincand2005.pdf
Previous << 1 .. 106 107 108 109 110 111 < 112 > 113 114 115 116 117 118 .. 168 >> Next

required but should be supplied as xltypeMissing. If this is not the reason for the
call, the DropListWidth argument is ignored.
8.12.8 Showing a toolbar button as pressed: xlfPressTool
Overview: Depresses or releases a button on a toolbar.
Enumeration value: 266 (x10a)
Callable from: Commands only.
Arguments: 1: BarID: A number of a built-in toolbar, or the text of a custom
toolbar.
2: Position: The position on the toolbar counting from 1 at the left if horizontal, or the top if vertical, at which tools are to be inserted. Can be a built-in or custom button.
3: Pressed: A Boolean value. The button is depressed if true, or normal if false or omitted.
Note: This function will not work on built-in buttons or buttons to which no command has been assigned.
8.12.9 Displaying or hiding a toolbar: xlcShowToolbar
Overview: Activates a toolbar.
Enumeration value: 32988 (x80dc)
Callable from: Commands only.
Arguments: 1: BarID: A number of a built-in toolbar, or the text of a
custom toolbar.
2: IsVisible: A Boolean value. The toolbar is visible if true, hidden if false.
3: DockPosition: 1 top; 2 left; 3 right; 4 bottom; 5 floating.
272
Excel Add-in Development in C/C++
4: HorizontalPosition: The distance in points between the left of the toolbar and (1) the left of the docking area if docked, (2) the right of the right-most toolbar in the left docking area if floating.
5: VerticalPosition: The distance in points between the top of the toolbar and the top of (1) the docking area if docked,
(2) Excel’s workspace if floating.
6: ToolbarWidth: The width in points. If omitted, the existing width is applied.
7: Protection: A number specifying the degree of protection given to the toolbar. (See Table 8.29 below.)
8: ShowToolTips: Boolean. Mouse-over ToolTips are displayed if true, not if false.
9: ShowLargeButtons: Boolean. Large buttons are displayed if true, not if false.
10: ShowColourButtons: Boolean. Toolbar buttons are displayed in colour if true, not if false.
Table 8.29 Toolbar protection parameter values
Protection Description
0 or omitted Can be resized, docked, floated and buttons can be added and removed.
1 As 0 except that buttons can not be added or removed.
2 As 1 except that it cannot be resized.
3 As 2 except that it cannot be moved between docked and floating states.
4 As 3 except that it cannot be moved at all.
8.12.10 Resetting a built-in toolbar: xlfResetToolbar
Overview: Resets a built-in toolbar.
Enumeration value: 256 (x100)
Callable from: Command and macro sheet functions.
Arguments: 1: BarID: The number of a built-in toolbar.
8.12.11 Deleting a button from a toolbar: xlcDeleteTool
Overview: Deletes a tool button from a toolbar.
Enumeration value: 33057 (x8121)
Accessing Excel Functionality Using the C API
273
Callable from: Commands only.
Arguments: 1: BarID: A number of a built-in toolbar, or the text of a custom
toolbar.
2: Position: The position on the toolbar counting from 1 at the left if horizontal, or the top if vertical, at which tools are to be inserted. Can be a built-in or custom button.
8.12.12 Deleting a custom toolbar: xlfDeleteToolbar
Overview: Deletes a custom toolbar.
Enumeration value: 254 (xfe)
Callable from: Commands and macro sheet functions.
Arguments: 1: BarName: The text name of a custom toolbar
8.13 WORKING WITH CUSTOM DIALOG BOXES
IMPORTANT NOTE: The C API only provides access to the dialog capabilities of the Excel 4.0 macro language which are very limited and awkward in comparison to those of VB or MFC. The C API does not support different font sizes, colours, and lacks some control objects: toggle buttons, spinner buttons, scroll bars, among others. Nevertheless, getting input from users, say, to configure a DLL function or to input a username, is something you might decide is most convenient to do using the C API. This section provides a bare-bones description of the relevant functions. You should use an alternative approach for more sophisticated interaction with the user.
8.13.1 Displaying an alert dialog box: xlcAlert
Overview: Displays an alert dialog.
Enumeration value: 32886 (x8076)
Callable from: Commands only.
Return type: Boolean. See Table 8.30 below.
Arguments: 1: Message: The message text (max length 255 characters: the
limit of a byte-counted string).
2: AlertType: An optional number determining the type of alert box. (See table below.)
3: HelpReference: An optional reference of the form
HelpFile!TopicNum. If this argument is given, a help button is displayed in the dialog.
274
Excel Add-in Development in C/C++
Table 8.30 xlcAlert dialog types
AlertType Description Return value
1 Displays message with an OK and a Cancel button. True if OK pressed. False if Cancel pressed.
2 or omitted Displays message with an OK button only and an information icon. True.
3 Displays message with an OK button only and a warning icon. True.
8.13.2 Displaying a custom dialog box: xlfDialogBox
IMPORTANT NOTE: It is recommended that this function is only used for relatively simple dialogs that need to be completely contained within an XLL add-in.
Previous << 1 .. 106 107 108 109 110 111 < 112 > 113 114 115 116 117 118 .. 168 >> Next