#include <ctrlhelp.h>
Inheritance diagram for ControlTable:
Public Member Functions | |
ControlTable () | |
Construct the control table object. | |
~ControlTable () | |
Destroy a ControlTable object - frees up all memory used by the table data. | |
BOOL | Init () |
Allocate and initialise the table of control entries. | |
ControlEntry * | FindControl (wxWindow *Window) |
Given a control's window handle, return the information currently registered for that control. Do not free the data pointed to by the return value. | |
BOOL | ChangeControl (wxWindow *, ControlHelpInfo *) |
Private Types | |
enum | { NotFound = -1, EmptySlot = 0, Granularity = 30, InitialSize = 100 } |
Private Member Functions | |
INT32 | FindControlIndex (wxWindow *Window, BOOL IgnoreChildren=TRUE) |
Given the window handle of a control, return the offset into the table array of its record, or optionally of the control's child windows. | |
Private Attributes | |
ControlEntry * | Table |
INT32 | TableSize |
wxWindow * | LastWindow |
INT32 | LastIndex |
Definition at line 354 of file ctrlhelp.h.
|
Definition at line 372 of file ctrlhelp.h. 00373 { 00374 NotFound = -1, 00375 EmptySlot = 0, 00376 Granularity = 30, 00377 InitialSize = 100 00378 };
|
|
Construct the control table object.
Definition at line 477 of file ctrlhelp.cpp. 00478 { 00479 // No table data yet. 00480 Table = NULL; 00481 TableSize = 0; 00482 00483 // Initial state 00484 LastWindow = NULL; 00485 LastIndex = 0; 00486 }
|
|
Destroy a ControlTable object - frees up all memory used by the table data.
Definition at line 499 of file ctrlhelp.cpp.
|
|
Definition at line 673 of file ctrlhelp.cpp. 00674 { 00675 INT32 i = FindControlIndex(Window); 00676 00677 if (i == ControlTable::NotFound) 00678 return FALSE; 00679 00680 Table[i].BubbleID = pInfo->BubbleID; 00681 Table[i].StatusID = pInfo->StatusID; 00682 Table[i].ModuleID = pInfo->ModuleID; 00683 00684 // Everything worked 00685 return TRUE; 00686 }
|
|
Given a control's window handle, return the information currently registered for that control. Do not free the data pointed to by the return value.
Definition at line 703 of file ctrlhelp.cpp. 00704 { 00705 INT32 i=FindControlIndex(Window); 00706 00707 if (i==ControlTable::NotFound) 00708 return NULL; 00709 00710 return Table + i; 00711 }
|
|
Given the window handle of a control, return the offset into the table array of its record, or optionally of the control's child windows.
Definition at line 733 of file ctrlhelp.cpp. 00734 { 00735 // Scan the table for this entry... 00736 INT32 i; 00737 00738 // Is this the same as the last window handle we looked for? 00739 // If so, start from the last slot we looked at. 00740 if (LastWindow == Window) 00741 i = LastIndex; 00742 else 00743 i = 0; 00744 00745 while ((i < TableSize) && (Table[i].Window != Window) && 00746 (IgnoreChildren || (Table[i].Parent != Window))) 00747 i++; 00748 00749 // Did we find it? 00750 if (i >= TableSize) 00751 // No - inform caller of failure. 00752 return ControlTable::NotFound; 00753 00754 // Yes, success 00755 LastIndex = i; 00756 LastWindow = Window; 00757 00758 return i; 00759 }
|
|
Allocate and initialise the table of control entries.
Reimplemented from SimpleCCObject. Definition at line 519 of file ctrlhelp.cpp. 00520 { 00521 // Try to get some space for our table. 00522 Table = (ControlEntry *) CCMalloc(ControlTable::InitialSize * sizeof(ControlEntry)); 00523 if (Table == NULL) 00524 return FALSE; 00525 00526 // Initialise the table 00527 for (INT32 i = 0; i < ControlTable::InitialSize; i++) 00528 { 00529 // No control registered in this entry yet 00530 Table[i].Window = EMPTY_SLOT; 00531 } 00532 00533 // Update the table size 00534 TableSize = ControlTable::InitialSize; 00535 00536 // Success! 00537 return TRUE; 00538 }
|
|
Definition at line 385 of file ctrlhelp.h. |
|
Definition at line 384 of file ctrlhelp.h. |
|
Definition at line 380 of file ctrlhelp.h. |
|
Definition at line 381 of file ctrlhelp.h. |