| Methods Index |
Subclasses: None
Helper Class:
CToolPaletteAttachment
CToolPalette provides the functionality required for a palette of images with the following qualifications:
CToolPalette serves as a logical palette object definition. Its interface allows you build palettes consisting of plain image buttons as well as image buttons representing nested subpalettes.The
CToolPalette interface allows you to operate upon the palette's tools in a recursive manner. For instance, the removal method operates recursively down the tools and subtools of the palette until it finds the tool to remove. To use palettes, you normally:
CToolPalette object.
CToolPalette interface.
CToolPalette::SetDragSource() to establish drag and drop between palette tools and sinks in your application.
CToolPalette::Popup() or CToolPalette::PopupDetached().
|
|
|
| friend class |
CToolPaletteButton;
|
| friend class |
CToolPaletteAttachment;
|
CToolPalette(const CStringRW& theTitle = NULLString);
CToolPalette(const CToolPalette &theToolPalette);
theToolPaltte.
CToolPalette & operator= (const CToolPalette &theToolPalette);
theToolPalette.
~CToolPalette();
void AppendTool(
CImage* theImage,
long theId,
BOOLEAN isDraggable = FALSE,
BOOLEAN isEnabled = TRUE);
theImage, a pointer which is consumed by the tool palette. The tool is identified by theId, a unique value which you can use in other CToolPalette methods that interact with tools.
void AppendTool(
CImage* theImage,
long theId,
CToolPalette* theSubPalette,
BOOLEAN isEnabled = TRUE);
theSubPalette, represented by a pointer which is consumed.
void InsertTool(
size_t theLocation,
CImage* theImage,
long theId,
BOOLEAN isDraggable = FALSE,
BOOLEAN isEnabled = TRUE);
theLocation, where the first tool is at location 0. The tool is represented by theImage, a pointer which is consumed by the tool palette, and identified by theId, a unique value which you can use in other CToolPalette methods that interact with tools.
void InsertTool(
size_t theLocation,
CImage* theImage,
long theId,
CToolPalette* theSubPalette,
BOOLEAN isEnabled = TRUE);
theSubPalette, represented by a pointer which is consumed.
CToolPalette* RemoveTool(long theId);
NULL.
CToolPalette* GetParent(void);
NULL.
void AppendSeparator(void); void InsertSeparatorAfter(long theId); void RemoveSeparatorAfter(long theId); void RemoveAllSeparators(BOOLEAN itIsRecursive = FALSE);
void EnableTool(long theId, BOOLEAN isEnabled); BOOLEAN IsToolEnabled(long theId) const;
void SelectTool(long theId); long GetSelectedTool(void) const; void DeselectTools(void); void DeselectAllTools(void); void DeselectLocalTools(void);
const CImage* GetToolImage(long theId);
void CloseSubPalettes(CToolPalette* anException = (CToolPalette *) NULL);
CToolPalette pointed to by anException.
void ClosePalettes(void);
void CloseAllPalettes(void);
CloseSubPalettes().
CToolPaletteAttachment* Popup(
CWindow* theWindow,
CPoint theTopLeft,
long theSelectCommand = NULLcmd,
BOOLEAN hasTitleBar = TRUE,
CAttachmentFrame* theFrame = NULL);
theWindow at the location indicated by theTopLeft. The tools of the CToolPalette are created inside the pop-up window. The pop-up generates theSelectCommand whenever a tool button is selected.
CToolPaletteAttachment* PopupDetached(
CWindow* theWindow,
CPoint theTopLeft,
long theSelectCommand = NULLcmd,
BOOLEAN hasTitleBar = TRUE,
CAttachmentFrame* theFrame = NULL);
theWindow indicated by theTopLeft. The pop-up generates theSelectCommand whenever a tool button is selected.
void SetDragSource(CDragSource *theDragSource); CDragSource* GetDragSource(void);
CDragSource used to drag-and-drop data from tool buttons. If a CDragSource is provided, the CToolPalette invokes the source's DoDrag() method in response to a button click and drag. The button's ID is passed along with the data of the drag command.
void SetTitle(const CStringRW& theNewTitle); const CStringRW& GetTitle(void) const;
void SetCommands(long theEnterCommand, long theLeaveCommand); long GetEnterCommand(void); long GetLeaveCommand(void);
CTool* FindTool(
long theId,
CToolPalette** aFoundPalette = (CToolPalette**)NULL,
int* aFoundIndex = (int*) NULL);
CTool* FindSubTool(
RWGSlist(CTool)* theSearchList,
long theId,
int* aFoundIndex = (int *)NULL);
virtual CToolPaletteAttachment* ConstructAttachment(
CWindow* theWindow,
long theCommand);
CToolPaletteAttachment for the palette.