#include <wxTreeMultiCtrl.h>
Public Member Functions | |
wxTreeMultiWindowInfo (int flags, int frontSpacing, int topSpacing) | |
int | Indent (int num=1) |
int | Outdent (int num=1) |
void | SetFrontSpacing (int frontSpacing) |
int | GetFrontSpacing () const |
void | SetTopSpacing (int topSpacing) |
int | GetTopSpacing () const |
int | SetFlags (int flags) |
int | GetFlags () const |
int | AddFlag (int flag_mask) |
int | RemoveFlag (int flag_mask) |
Private Attributes | |
int | _flags |
int | _frontSpacing |
int | _frontSpacingOrg |
int | _topSpacing |
This class can be used to modify the behaviour of the Window node to be added, and can be reused to pass along upon every wxTreeMultiCtrl::AppendWindow call. For example:
wxTreeMultiWindowInfo wndinfo; MyTreeMultiCtrl->AppendWindow(item, new wxStaticText(MyTreeMultiCtrl, -1, "Press this button"), "", wndinfo)); // now adjust the spacing of our next window to add, by indenting // 4 times the indent size wndinfo.Indent(4); MyTreeMultiCtrl->AppendWindow(item, new wxButton(MyTreeMultiCtrl, -1, "Apply"), "", wndinfo);
The class is created to prevent long parameter lists in the functions. Other ways to manipulate a newly added Window node are;
Definition at line 347 of file wxTreeMultiCtrl.h.
wxTreeMultiWindowInfo::wxTreeMultiWindowInfo | ( | int | flags, | |
int | frontSpacing, | |||
int | topSpacing | |||
) | [inline] |
Definition at line 376 of file wxTreeMultiCtrl.h.
00377 : _flags(flags) 00378 , _frontSpacing(frontSpacing) 00379 , _frontSpacingOrg(frontSpacing) 00380 , _topSpacing(topSpacing) 00381 #endif 00382 { 00383 // constructor 00384 }
int wxTreeMultiWindowInfo::AddFlag | ( | int | flag_mask | ) | [inline] |
Or's the given flag with the current flagset, and adds it. The old flag set is returned before the OR is applied.
Definition at line 457 of file wxTreeMultiCtrl.h.
References _flags.
int wxTreeMultiWindowInfo::GetFlags | ( | ) | const [inline] |
Gets the current flags set.
Definition at line 449 of file wxTreeMultiCtrl.h.
References _flags.
00449 { 00450 return _flags; 00451 };
int wxTreeMultiWindowInfo::GetFrontSpacing | ( | ) | const [inline] |
Gets front spacing. This will return the current indent level set. If Indent or Outdent is used, this level represents the current Indent level.
Definition at line 419 of file wxTreeMultiCtrl.h.
References _frontSpacing.
00419 { 00420 return _frontSpacing; 00421 };
int wxTreeMultiWindowInfo::GetTopSpacing | ( | ) | const [inline] |
Definition at line 433 of file wxTreeMultiCtrl.h.
References _topSpacing.
00433 { 00434 return _topSpacing; 00435 };
int wxTreeMultiWindowInfo::Indent | ( | int | num = 1 |
) | [inline] |
Adds indent to original front spacing and increments it with that value (quick extra indent). The original value of FrontSpacing (see SetFrontSpacing() gets indented by multiplying the 'num' factor (default = 1) times the indent value. So if the FrontSpacing was set to 10, and Indent(2) is called, the new indent will be 30. (10 + 2 * 10). The original FrontSpacing value is remembered, so calling Outdent(2) will bring it back to 10 (30 - (2*10). Calling SetFrontSpacing with a new value, deletes the old indent.
Definition at line 394 of file wxTreeMultiCtrl.h.
References _frontSpacing, and _frontSpacingOrg.
00394 { 00395 if(num > 0) 00396 _frontSpacing += (_frontSpacingOrg * num); 00397 return _frontSpacing; 00398 };
int wxTreeMultiWindowInfo::Outdent | ( | int | num = 1 |
) | [inline] |
Reduces indent a number of times, by subtracting 'num' times the original FrontSpacing value from the current FrontSpacing value (quick extra indent). Thus if the original FrontSpacing was set to 10, and the current indent value is 40, Outdent(2) will do 40 - (2 * 10) = 20
Definition at line 405 of file wxTreeMultiCtrl.h.
References _frontSpacing, and _frontSpacingOrg.
00405 { 00406 _frontSpacing -= (_frontSpacingOrg * num); 00407 if(_frontSpacing < 0) 00408 _frontSpacing = 0; 00409 return _frontSpacing; 00410 };
int wxTreeMultiWindowInfo::RemoveFlag | ( | int | flag_mask | ) | [inline] |
And's the given flag in a negated manner and removes this flag set from the current flags. The old flag set is returned.
Definition at line 467 of file wxTreeMultiCtrl.h.
References _flags.
int wxTreeMultiWindowInfo::SetFlags | ( | int | flags | ) | [inline] |
Sets the current flags set, and returns previous flags state.
Definition at line 440 of file wxTreeMultiCtrl.h.
References _flags.
void wxTreeMultiWindowInfo::SetFrontSpacing | ( | int | frontSpacing | ) | [inline] |
Sets FrontSpacing value. This also resets the current indent level.
Definition at line 413 of file wxTreeMultiCtrl.h.
References _frontSpacing, and _frontSpacingOrg.
00413 { 00414 _frontSpacing = frontSpacing; 00415 _frontSpacingOrg = frontSpacing; 00416 };
void wxTreeMultiWindowInfo::SetTopSpacing | ( | int | topSpacing | ) | [inline] |
Sets top spacing. This means the number of pixels spacing between the last node and the next one to be added.
Definition at line 426 of file wxTreeMultiCtrl.h.
References _topSpacing.
00426 { 00427 _topSpacing = topSpacing; 00428 if(_topSpacing < 0) 00429 _topSpacing = 0; 00430 };
int wxTreeMultiWindowInfo::_flags [private] |
Flag that indicates that every window background in the assigned wxWindow needs te be overriden with the current colour of the TreeMultiCtrl. This is a deep adjustment and will do every subwindow until none are left. If 'false' no adjustment is done. For AppendWindow only
Definition at line 353 of file wxTreeMultiCtrl.h.
Referenced by AddFlag(), GetFlags(), RemoveFlag(), and SetFlags().
int wxTreeMultiWindowInfo::_frontSpacing [private] |
Extra indent for every item that is added. This will add front spacing to the item's x calculation. For AppendNode and AppendWindow. Spacing is added behind the collapse image not in front.
Definition at line 356 of file wxTreeMultiCtrl.h.
Referenced by GetFrontSpacing(), Indent(), Outdent(), and SetFrontSpacing().
int wxTreeMultiWindowInfo::_frontSpacingOrg [private] |
Definition at line 356 of file wxTreeMultiCtrl.h.
Referenced by Indent(), Outdent(), and SetFrontSpacing().
int wxTreeMultiWindowInfo::_topSpacing [private] |
Extra top spacing for every item that is added. This will add top spacing to the item's y calculation
Definition at line 360 of file wxTreeMultiCtrl.h.
Referenced by GetTopSpacing(), and SetTopSpacing().