class WXDLLIMPEXP_AUI wxAuiToolBarEvent : public wxNotifyEvent
{
public:
- wxAuiToolBarEvent(wxEventType command_type = wxEVT_NULL,
- int win_id = 0)
- : wxNotifyEvent(command_type, win_id)
+ wxAuiToolBarEvent(wxEventType commandType = wxEVT_NULL,
+ int winId = 0)
+ : wxNotifyEvent(commandType, winId)
{
- is_dropdown_clicked = false;
- click_pt = wxPoint(-1, -1);
- rect = wxRect(-1,-1, 0, 0);
- tool_id = -1;
+ m_isDropdownClicked = false;
+ m_clickPt = wxPoint(-1, -1);
+ m_rect = wxRect(-1,-1, 0, 0);
+ m_toolId = -1;
}
#ifndef SWIG
wxAuiToolBarEvent(const wxAuiToolBarEvent& c) : wxNotifyEvent(c)
{
- is_dropdown_clicked = c.is_dropdown_clicked;
- click_pt = c.click_pt;
- rect = c.rect;
- tool_id = c.tool_id;
+ m_isDropdownClicked = c.m_isDropdownClicked;
+ m_clickPt = c.m_clickPt;
+ m_rect = c.m_rect;
+ m_toolId = c.m_toolId;
}
#endif
wxEvent *Clone() const { return new wxAuiToolBarEvent(*this); }
- bool IsDropDownClicked() const { return is_dropdown_clicked; }
- void SetDropDownClicked(bool c) { is_dropdown_clicked = c; }
+ bool IsDropDownClicked() const { return m_isDropdownClicked; }
+ void SetDropDownClicked(bool c) { m_isDropdownClicked = c; }
- wxPoint GetClickPoint() const { return click_pt; }
- void SetClickPoint(const wxPoint& p) { click_pt = p; }
+ wxPoint GetClickPoint() const { return m_clickPt; }
+ void SetClickPoint(const wxPoint& p) { m_clickPt = p; }
- wxRect GetItemRect() const { return rect; }
- void SetItemRect(const wxRect& r) { rect = r; }
+ wxRect GetItemRect() const { return m_rect; }
+ void SetItemRect(const wxRect& r) { m_rect = r; }
- int GetToolId() const { return tool_id; }
- void SetToolId(int toolid) { tool_id = toolid; }
+ int GetToolId() const { return m_toolId; }
+ void SetToolId(int toolId) { m_toolId = toolId; }
private:
- bool is_dropdown_clicked;
- wxPoint click_pt;
- wxRect rect;
- int tool_id;
+ bool m_isDropdownClicked;
+ wxPoint m_clickPt;
+ wxRect m_rect;
+ int m_toolId;
private:
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxAuiToolBarEvent)
wxAuiToolBarItem()
{
- window = NULL;
- sizer_item = NULL;
- spacer_pixels = 0;
- toolid = 0;
- kind = wxITEM_NORMAL;
- state = 0; // normal, enabled
- proportion = 0;
- active = true;
- dropdown = true;
- sticky = true;
- user_data = 0;
- alignment = wxALIGN_CENTER;
+ m_window = NULL;
+ m_sizerItem = NULL;
+ m_spacerPixels = 0;
+ m_toolId = 0;
+ m_kind = wxITEM_NORMAL;
+ m_state = 0; // normal, enabled
+ m_proportion = 0;
+ m_active = true;
+ m_dropDown = true;
+ m_sticky = true;
+ m_userData = 0;
+ m_alignment = wxALIGN_CENTER;
}
wxAuiToolBarItem(const wxAuiToolBarItem& c)
void Assign(const wxAuiToolBarItem& c)
{
- window = c.window;
- label = c.label;
- bitmap = c.bitmap;
- disabled_bitmap = c.disabled_bitmap;
- hover_bitmap = c.hover_bitmap;
- short_help = c.short_help;
- long_help = c.long_help;
- sizer_item = c.sizer_item;
- min_size = c.min_size;
- spacer_pixels = c.spacer_pixels;
- toolid = c.toolid;
- kind = c.kind;
- state = c.state;
- proportion = c.proportion;
- active = c.active;
- dropdown = c.dropdown;
- sticky = c.sticky;
- user_data = c.user_data;
- alignment = c.alignment;
+ m_window = c.m_window;
+ m_label = c.m_label;
+ m_bitmap = c.m_bitmap;
+ m_disabledBitmap = c.m_disabledBitmap;
+ m_hoverBitmap = c.m_hoverBitmap;
+ m_shortHelp = c.m_shortHelp;
+ m_longHelp = c.m_longHelp;
+ m_sizerItem = c.m_sizerItem;
+ m_minSize = c.m_minSize;
+ m_spacerPixels = c.m_spacerPixels;
+ m_toolId = c.m_toolId;
+ m_kind = c.m_kind;
+ m_state = c.m_state;
+ m_proportion = c.m_proportion;
+ m_active = c.m_active;
+ m_dropDown = c.m_dropDown;
+ m_sticky = c.m_sticky;
+ m_userData = c.m_userData;
+ m_alignment = c.m_alignment;
}
- void SetWindow(wxWindow* w) { window = w; }
- wxWindow* GetWindow() { return window; }
+ void SetWindow(wxWindow* w) { m_window = w; }
+ wxWindow* GetWindow() { return m_window; }
- void SetId(int new_id) { toolid = new_id; }
- int GetId() const { return toolid; }
+ void SetId(int newId) { m_toolId = newId; }
+ int GetId() const { return m_toolId; }
- void SetKind(int new_kind) { kind = new_kind; }
- int GetKind() const { return kind; }
+ void SetKind(int newKind) { m_kind = newKind; }
+ int GetKind() const { return m_kind; }
- void SetState(int new_state) { state = new_state; }
- int GetState() const { return state; }
+ void SetState(int newState) { m_state = newState; }
+ int GetState() const { return m_state; }
- void SetSizerItem(wxSizerItem* s) { sizer_item = s; }
- wxSizerItem* GetSizerItem() const { return sizer_item; }
+ void SetSizerItem(wxSizerItem* s) { m_sizerItem = s; }
+ wxSizerItem* GetSizerItem() const { return m_sizerItem; }
- void SetLabel(const wxString& s) { label = s; }
- const wxString& GetLabel() const { return label; }
+ void SetLabel(const wxString& s) { m_label = s; }
+ const wxString& GetLabel() const { return m_label; }
- void SetBitmap(const wxBitmap& bmp) { bitmap = bmp; }
- const wxBitmap& GetBitmap() const { return bitmap; }
+ void SetBitmap(const wxBitmap& bmp) { m_bitmap = bmp; }
+ const wxBitmap& GetBitmap() const { return m_bitmap; }
- void SetDisabledBitmap(const wxBitmap& bmp) { disabled_bitmap = bmp; }
- const wxBitmap& GetDisabledBitmap() const { return disabled_bitmap; }
+ void SetDisabledBitmap(const wxBitmap& bmp) { m_disabledBitmap = bmp; }
+ const wxBitmap& GetDisabledBitmap() const { return m_disabledBitmap; }
- void SetHoverBitmap(const wxBitmap& bmp) { hover_bitmap = bmp; }
- const wxBitmap& GetHoverBitmap() const { return hover_bitmap; }
+ void SetHoverBitmap(const wxBitmap& bmp) { m_hoverBitmap = bmp; }
+ const wxBitmap& GetHoverBitmap() const { return m_hoverBitmap; }
- void SetShortHelp(const wxString& s) { short_help = s; }
- const wxString& GetShortHelp() const { return short_help; }
+ void SetShortHelp(const wxString& s) { m_shortHelp = s; }
+ const wxString& GetShortHelp() const { return m_shortHelp; }
- void SetLongHelp(const wxString& s) { long_help = s; }
- const wxString& GetLongHelp() const { return long_help; }
+ void SetLongHelp(const wxString& s) { m_longHelp = s; }
+ const wxString& GetLongHelp() const { return m_longHelp; }
- void SetMinSize(const wxSize& s) { min_size = s; }
- const wxSize& GetMinSize() const { return min_size; }
+ void SetMinSize(const wxSize& s) { m_minSize = s; }
+ const wxSize& GetMinSize() const { return m_minSize; }
- void SetSpacerPixels(int s) { spacer_pixels = s; }
- int GetSpacerPixels() const { return spacer_pixels; }
+ void SetSpacerPixels(int s) { m_spacerPixels = s; }
+ int GetSpacerPixels() const { return m_spacerPixels; }
- void SetProportion(int p) { proportion = p; }
- int GetProportion() const { return proportion; }
+ void SetProportion(int p) { m_proportion = p; }
+ int GetProportion() const { return m_proportion; }
- void SetActive(bool b) { active = b; }
- bool IsActive() const { return active; }
+ void SetActive(bool b) { m_active = b; }
+ bool IsActive() const { return m_active; }
- void SetHasDropDown(bool b) { dropdown = b; }
- bool HasDropDown() const { return dropdown; }
+ void SetHasDropDown(bool b) { m_dropDown = b; }
+ bool HasDropDown() const { return m_dropDown; }
- void SetSticky(bool b) { sticky = b; }
- bool IsSticky() const { return sticky; }
+ void SetSticky(bool b) { m_sticky = b; }
+ bool IsSticky() const { return m_sticky; }
- void SetUserData(long l) { user_data = l; }
- long GetUserData() const { return user_data; }
+ void SetUserData(long l) { m_userData = l; }
+ long GetUserData() const { return m_userData; }
- void SetAlignment(int l) { alignment = l; }
- int GetAlignment() const { return alignment; }
+ void SetAlignment(int l) { m_alignment = l; }
+ int GetAlignment() const { return m_alignment; }
private:
- wxWindow* window; // item's associated window
- wxString label; // label displayed on the item
- wxBitmap bitmap; // item's bitmap
- wxBitmap disabled_bitmap; // item's disabled bitmap
- wxBitmap hover_bitmap; // item's hover bitmap
- wxString short_help; // short help (for tooltip)
- wxString long_help; // long help (for status bar)
- wxSizerItem* sizer_item; // sizer item
- wxSize min_size; // item's minimum size
- int spacer_pixels; // size of a spacer
- int toolid; // item's id
- int kind; // item's kind
- int state; // state
- int proportion; // proportion
- bool active; // true if the item is currently active
- bool dropdown; // true if the item has a dropdown button
- bool sticky; // overrides button states if true (always active)
- long user_data; // user-specified data
- int alignment; // sizer alignment flag, defaults to wxCENTER, may be wxEXPAND or any other
+ wxWindow* m_window; // item's associated window
+ wxString m_label; // label displayed on the item
+ wxBitmap m_bitmap; // item's bitmap
+ wxBitmap m_disabledBitmap; // item's disabled bitmap
+ wxBitmap m_hoverBitmap; // item's hover bitmap
+ wxString m_shortHelp; // short help (for tooltip)
+ wxString m_longHelp; // long help (for status bar)
+ wxSizerItem* m_sizerItem; // sizer item
+ wxSize m_minSize; // item's minimum size
+ int m_spacerPixels; // size of a spacer
+ int m_toolId; // item's id
+ int m_kind; // item's kind
+ int m_state; // state
+ int m_proportion; // proportion
+ bool m_active; // true if the item is currently active
+ bool m_dropDown; // true if the item has a dropdown button
+ bool m_sticky; // overrides button states if true (always active)
+ long m_userData; // user-specified data
+ int m_alignment; // sizer alignment flag, defaults to wxCENTER, may be wxEXPAND or any other
};
#ifndef SWIG
wxWindow* wnd,
const wxAuiToolBarItem& item) = 0;
- virtual int GetElementSize(int element_id) = 0;
- virtual void SetElementSize(int element_id, int size) = 0;
+ virtual int GetElementSize(int elementId) = 0;
+ virtual void SetElementSize(int elementId, int size) = 0;
virtual int ShowDropDown(
wxWindow* wnd,
const wxAuiToolBarItem& item);
virtual int GetElementSize(int element);
- virtual void SetElementSize(int element_id, int size);
+ virtual void SetElementSize(int elementId, int size);
virtual int ShowDropDown(wxWindow* wnd,
const wxAuiToolBarItemArray& items);
protected:
- wxBitmap m_button_dropdown_bmp;
- wxBitmap m_disabled_button_dropdown_bmp;
- wxBitmap m_overflow_bmp;
- wxBitmap m_disabled_overflow_bmp;
- wxColour m_base_colour;
- wxColour m_highlight_colour;
+ wxBitmap m_buttonDropDownBmp;
+ wxBitmap m_disabledButtonDropDownBmp;
+ wxBitmap m_overflowBmp;
+ wxBitmap m_disabledOverflowBmp;
+ wxColour m_baseColour;
+ wxColour m_highlightColour;
wxFont m_font;
unsigned int m_flags;
- int m_text_orientation;
+ int m_textOrientation;
- wxPen m_gripper_pen1;
- wxPen m_gripper_pen2;
- wxPen m_gripper_pen3;
+ wxPen m_gripperPen1;
+ wxPen m_gripperPen2;
+ wxPen m_gripperPen3;
- int m_separator_size;
- int m_gripper_size;
- int m_overflow_size;
+ int m_separatorSize;
+ int m_gripperSize;
+ int m_overflowSize;
};
bool SetFont(const wxFont& font);
- wxAuiToolBarItem* AddTool(int tool_id,
+ wxAuiToolBarItem* AddTool(int toolId,
const wxString& label,
const wxBitmap& bitmap,
- const wxString& short_help_string = wxEmptyString,
+ const wxString& shortHelpString = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL);
- wxAuiToolBarItem* AddTool(int tool_id,
+ wxAuiToolBarItem* AddTool(int toolId,
const wxString& label,
const wxBitmap& bitmap,
- const wxBitmap& disabled_bitmap,
+ const wxBitmap& disabledBitmap,
wxItemKind kind,
- const wxString& short_help_string,
- const wxString& long_help_string,
- wxObject* client_data);
+ const wxString& shortHelpString,
+ const wxString& longHelpString,
+ wxObject* clientData);
- wxAuiToolBarItem* AddTool(int tool_id,
+ wxAuiToolBarItem* AddTool(int toolId,
const wxBitmap& bitmap,
- const wxBitmap& disabled_bitmap,
+ const wxBitmap& disabledBitmap,
bool toggle = false,
- wxObject* client_data = NULL,
- const wxString& short_help_string = wxEmptyString,
- const wxString& long_help_string = wxEmptyString)
+ wxObject* clientData = NULL,
+ const wxString& shortHelpString = wxEmptyString,
+ const wxString& longHelpString = wxEmptyString)
{
- return AddTool(tool_id,
+ return AddTool(toolId,
wxEmptyString,
bitmap,
- disabled_bitmap,
+ disabledBitmap,
toggle ? wxITEM_CHECK : wxITEM_NORMAL,
- short_help_string,
- long_help_string,
- client_data);
+ shortHelpString,
+ longHelpString,
+ clientData);
}
- wxAuiToolBarItem* AddLabel(int tool_id,
+ wxAuiToolBarItem* AddLabel(int toolId,
const wxString& label = wxEmptyString,
const int width = -1);
wxAuiToolBarItem* AddControl(wxControl* control,
bool Realize();
- wxControl* FindControl(int window_id);
+ wxControl* FindControl(int windowId);
wxAuiToolBarItem* FindToolByPosition(wxCoord x, wxCoord y) const;
wxAuiToolBarItem* FindToolByIndex(int idx) const;
- wxAuiToolBarItem* FindTool(int tool_id) const;
+ wxAuiToolBarItem* FindTool(int toolId) const;
void ClearTools() { Clear() ; }
void Clear();
- bool DeleteTool(int tool_id);
- bool DeleteByIndex(int tool_id);
+ bool DeleteTool(int toolId);
+ bool DeleteByIndex(int toolId);
size_t GetToolCount() const;
- int GetToolPos(int tool_id) const { return GetToolIndex(tool_id); }
- int GetToolIndex(int tool_id) const;
- bool GetToolFits(int tool_id) const;
- wxRect GetToolRect(int tool_id) const;
- bool GetToolFitsByIndex(int tool_id) const;
+ int GetToolPos(int toolId) const { return GetToolIndex(toolId); }
+ int GetToolIndex(int toolId) const;
+ bool GetToolFits(int toolId) const;
+ wxRect GetToolRect(int toolId) const;
+ bool GetToolFitsByIndex(int toolId) const;
bool GetToolBarFits() const;
void SetMargins(const wxSize& size) { SetMargins(size.x, size.x, size.y, size.y); }
bool GetGripperVisible() const;
void SetGripperVisible(bool visible);
- void ToggleTool(int tool_id, bool state);
- bool GetToolToggled(int tool_id) const;
+ void ToggleTool(int toolId, bool state);
+ bool GetToolToggled(int toolId) const;
- void EnableTool(int tool_id, bool state);
- bool GetToolEnabled(int tool_id) const;
+ void EnableTool(int toolId, bool state);
+ bool GetToolEnabled(int toolId) const;
- void SetToolDropDown(int tool_id, bool dropdown);
- bool GetToolDropDown(int tool_id) const;
+ void SetToolDropDown(int toolId, bool dropdown);
+ bool GetToolDropDown(int toolId) const;
void SetToolBorderPadding(int padding);
int GetToolBorderPadding() const;
void SetToolPacking(int packing);
int GetToolPacking() const;
- void SetToolProportion(int tool_id, int proportion);
- int GetToolProportion(int tool_id) const;
+ void SetToolProportion(int toolId, int proportion);
+ int GetToolProportion(int toolId) const;
void SetToolSeparation(int separation);
int GetToolSeparation() const;
- void SetToolSticky(int tool_id, bool sticky);
- bool GetToolSticky(int tool_id) const;
+ void SetToolSticky(int toolId, bool sticky);
+ bool GetToolSticky(int toolId) const;
- wxString GetToolLabel(int tool_id) const;
- void SetToolLabel(int tool_id, const wxString& label);
+ wxString GetToolLabel(int toolId) const;
+ void SetToolLabel(int toolId, const wxString& label);
- wxBitmap GetToolBitmap(int tool_id) const;
- void SetToolBitmap(int tool_id, const wxBitmap& bitmap);
+ wxBitmap GetToolBitmap(int toolId) const;
+ void SetToolBitmap(int toolId, const wxBitmap& bitmap);
- wxString GetToolShortHelp(int tool_id) const;
- void SetToolShortHelp(int tool_id, const wxString& help_string);
+ wxString GetToolShortHelp(int toolId) const;
+ void SetToolShortHelp(int toolId, const wxString& helpString);
- wxString GetToolLongHelp(int tool_id) const;
- void SetToolLongHelp(int tool_id, const wxString& help_string);
+ wxString GetToolLongHelp(int toolId) const;
+ void SetToolLongHelp(int toolId, const wxString& helpString);
void SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend,
const wxAuiToolBarItemArray& append);
// get size of hint rectangle for a particular dock location
- wxSize GetHintSize(int dock_direction) const;
+ wxSize GetHintSize(int dockDirection) const;
bool IsPaneValid(const wxAuiPaneInfo& pane) const;
protected:
wxAuiToolBarItemArray m_items; // array of toolbar items
wxAuiToolBarArt* m_art; // art provider
wxBoxSizer* m_sizer; // main sizer for toolbar
- wxAuiToolBarItem* m_action_item; // item that's being acted upon (pressed)
- wxAuiToolBarItem* m_tip_item; // item that has its tooltip shown
+ wxAuiToolBarItem* m_actionItem; // item that's being acted upon (pressed)
+ wxAuiToolBarItem* m_tipItem; // item that has its tooltip shown
wxBitmap m_bitmap; // double-buffer bitmap
- wxSizerItem* m_gripper_sizer_item;
- wxSizerItem* m_overflow_sizer_item;
- wxSize m_absolute_min_size;
- wxPoint m_action_pos; // position of left-mouse down
- wxAuiToolBarItemArray m_custom_overflow_prepend;
- wxAuiToolBarItemArray m_custom_overflow_append;
-
- int m_button_width;
- int m_button_height;
- int m_sizer_element_count;
- int m_left_padding;
- int m_right_padding;
- int m_top_padding;
- int m_bottom_padding;
- int m_tool_packing;
- int m_tool_border_padding;
- int m_tool_text_orientation;
- int m_overflow_state;
+ wxSizerItem* m_gripperSizerItem;
+ wxSizerItem* m_overflowSizerItem;
+ wxSize m_absoluteMinSize;
+ wxPoint m_actionPos; // position of left-mouse down
+ wxAuiToolBarItemArray m_customOverflowPrepend;
+ wxAuiToolBarItemArray m_customOverflowAppend;
+
+ int m_buttonWidth;
+ int m_buttonHeight;
+ int m_sizerElementCount;
+ int m_leftPadding;
+ int m_rightPadding;
+ int m_topPadding;
+ int m_bottomPadding;
+ int m_toolPacking;
+ int m_toolBorderPadding;
+ int m_toolTextOrientation;
+ int m_overflowState;
bool m_dragging;
- bool m_gripper_visible;
- bool m_overflow_visible;
+ bool m_gripperVisible;
+ bool m_overflowVisible;
long m_style;
bool RealizeHelper(wxClientDC& dc, bool horizontal);
class WXDLLIMPEXP_AUI wxAuiNotebookEvent : public wxBookCtrlEvent
{
public:
- wxAuiNotebookEvent(wxEventType command_type = wxEVT_NULL,
- int win_id = 0)
- : wxBookCtrlEvent(command_type, win_id)
+ wxAuiNotebookEvent(wxEventType commandType = wxEVT_NULL,
+ int winId = 0)
+ : wxBookCtrlEvent(commandType, winId)
{
- drag_source = NULL;
+ m_dragSource = NULL;
}
#ifndef SWIG
wxAuiNotebookEvent(const wxAuiNotebookEvent& c) : wxBookCtrlEvent(c)
{
- drag_source = c.drag_source;
+ m_dragSource = c.m_dragSource;
}
#endif
wxEvent *Clone() const { return new wxAuiNotebookEvent(*this); }
- void SetDragSource(wxAuiNotebook* s) { drag_source = s; }
- wxAuiNotebook* GetDragSource() const { return drag_source; }
+ void SetDragSource(wxAuiNotebook* s) { m_dragSource = s; }
+ wxAuiNotebook* GetDragSource() const { return m_dragSource; }
-public:
- wxAuiNotebook* drag_source;
+private:
+ wxAuiNotebook* m_dragSource;
#ifndef SWIG
private:
public:
int id; // button's id
- int cur_state; // current state (normal, hover, pressed, etc.)
+ int curState; // current state (normal, hover, pressed, etc.)
int location; // buttons location (wxLEFT, wxRIGHT, or wxCENTER)
wxBitmap bitmap; // button's hover bitmap
- wxBitmap dis_bitmap; // button's disabled bitmap
+ wxBitmap disBitmap; // button's disabled bitmap
wxRect rect; // button's hit rectangle
};
virtual wxAuiTabArt* Clone() = 0;
virtual void SetFlags(unsigned int flags) = 0;
- virtual void SetSizingInfo(const wxSize& tab_ctrl_size,
- size_t tab_count) = 0;
+ virtual void SetSizingInfo(const wxSize& tabCtrlSize,
+ size_t tabCount) = 0;
virtual void SetNormalFont(const wxFont& font) = 0;
virtual void SetSelectedFont(const wxFont& font) = 0;
virtual void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& pane,
- const wxRect& in_rect,
- int close_button_state,
- wxRect* out_tab_rect,
- wxRect* out_button_rect,
- int* x_extent) = 0;
+ const wxRect& inRect,
+ int closeButtonState,
+ wxRect* outTabRect,
+ wxRect* outButtonRect,
+ int* xExtent) = 0;
virtual void DrawButton(
wxDC& dc,
wxWindow* wnd,
- const wxRect& in_rect,
- int bitmap_id,
- int button_state,
+ const wxRect& inRect,
+ int bitmapId,
+ int buttonState,
int orientation,
- wxRect* out_rect) = 0;
+ wxRect* outRect) = 0;
virtual wxSize GetTabSize(
wxDC& dc,
const wxString& caption,
const wxBitmap& bitmap,
bool active,
- int close_button_state,
- int* x_extent) = 0;
+ int closeButtonState,
+ int* xExtent) = 0;
virtual int ShowDropDown(
wxWindow* wnd,
const wxAuiNotebookPageArray& items,
- int active_idx) = 0;
+ int activeIdx) = 0;
virtual int GetIndentSize() = 0;
virtual int GetBestTabCtrlSize(
wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
- const wxSize& required_bmp_size) = 0;
+ const wxSize& requiredBmpSize) = 0;
};
wxAuiTabArt* Clone();
void SetFlags(unsigned int flags);
- void SetSizingInfo(const wxSize& tab_ctrl_size,
- size_t tab_count);
+ void SetSizingInfo(const wxSize& tabCtrlSize,
+ size_t tabCount);
void SetNormalFont(const wxFont& font);
void SetSelectedFont(const wxFont& font);
void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& pane,
- const wxRect& in_rect,
- int close_button_state,
- wxRect* out_tab_rect,
- wxRect* out_button_rect,
- int* x_extent);
+ const wxRect& inRect,
+ int closeButtonState,
+ wxRect* outTabRect,
+ wxRect* outButtonRect,
+ int* xExtent);
void DrawButton(
wxDC& dc,
wxWindow* wnd,
- const wxRect& in_rect,
- int bitmap_id,
- int button_state,
+ const wxRect& inRect,
+ int bitmapId,
+ int buttonState,
int orientation,
- wxRect* out_rect);
+ wxRect* outRect);
int GetIndentSize();
const wxString& caption,
const wxBitmap& bitmap,
bool active,
- int close_button_state,
- int* x_extent);
+ int closeButtonState,
+ int* xExtent);
int ShowDropDown(
wxWindow* wnd,
const wxAuiNotebookPageArray& items,
- int active_idx);
+ int activeIdx);
int GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
- const wxSize& required_bmp_size);
+ const wxSize& requiredBmpSize);
protected:
- wxFont m_normal_font;
- wxFont m_selected_font;
- wxFont m_measuring_font;
- wxColour m_base_colour;
- wxPen m_base_colour_pen;
- wxPen m_border_pen;
- wxBrush m_base_colour_brush;
- wxColour m_active_colour;
- wxBitmap m_active_close_bmp;
- wxBitmap m_disabled_close_bmp;
- wxBitmap m_active_left_bmp;
- wxBitmap m_disabled_left_bmp;
- wxBitmap m_active_right_bmp;
- wxBitmap m_disabled_right_bmp;
- wxBitmap m_active_windowlist_bmp;
- wxBitmap m_disabled_windowlist_bmp;
-
- int m_fixed_tab_width;
- int m_tab_ctrl_height;
+ wxFont m_normalFont;
+ wxFont m_selectedFont;
+ wxFont m_measuringFont;
+ wxColour m_baseColour;
+ wxPen m_baseColourPen;
+ wxPen m_borderPen;
+ wxBrush m_baseColourBrush;
+ wxColour m_activeColour;
+ wxBitmap m_activeCloseBmp;
+ wxBitmap m_disabledCloseBmp;
+ wxBitmap m_activeLeftBmp;
+ wxBitmap m_disabledLeftBmp;
+ wxBitmap m_activeRightBmp;
+ wxBitmap m_disabledRightBmp;
+ wxBitmap m_activeWindowListBmp;
+ wxBitmap m_disabledWindowListBmp;
+
+ int m_fixedTabWidth;
+ int m_tabCtrlHeight;
unsigned int m_flags;
};
wxAuiTabArt* Clone();
void SetFlags(unsigned int flags);
- void SetSizingInfo(const wxSize& tab_ctrl_size,
- size_t tab_count);
+ void SetSizingInfo(const wxSize& tabCtrlSize,
+ size_t tabCount);
void SetNormalFont(const wxFont& font);
void SetSelectedFont(const wxFont& font);
void DrawTab(wxDC& dc,
wxWindow* wnd,
const wxAuiNotebookPage& pane,
- const wxRect& in_rect,
- int close_button_state,
- wxRect* out_tab_rect,
- wxRect* out_button_rect,
- int* x_extent);
+ const wxRect& inRect,
+ int closeButtonState,
+ wxRect* outTabRect,
+ wxRect* outButtonRect,
+ int* xExtent);
void DrawButton(
wxDC& dc,
wxWindow* wnd,
- const wxRect& in_rect,
- int bitmap_id,
- int button_state,
+ const wxRect& inRect,
+ int bitmapId,
+ int buttonState,
int orientation,
- wxRect* out_rect);
+ wxRect* outRect);
int GetIndentSize();
const wxString& caption,
const wxBitmap& bitmap,
bool active,
- int close_button_state,
- int* x_extent);
+ int closeButtonState,
+ int* xExtent);
int ShowDropDown(
wxWindow* wnd,
const wxAuiNotebookPageArray& items,
- int active_idx);
+ int activeIdx);
int GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
- const wxSize& required_bmp_size);
+ const wxSize& requiredBmpSize);
protected:
- wxFont m_normal_font;
- wxFont m_selected_font;
- wxFont m_measuring_font;
- wxPen m_normal_bkpen;
- wxPen m_selected_bkpen;
- wxBrush m_normal_bkbrush;
- wxBrush m_selected_bkbrush;
- wxBrush m_bkbrush;
- wxBitmap m_active_close_bmp;
- wxBitmap m_disabled_close_bmp;
- wxBitmap m_active_left_bmp;
- wxBitmap m_disabled_left_bmp;
- wxBitmap m_active_right_bmp;
- wxBitmap m_disabled_right_bmp;
- wxBitmap m_active_windowlist_bmp;
- wxBitmap m_disabled_windowlist_bmp;
-
- int m_fixed_tab_width;
+ wxFont m_normalFont;
+ wxFont m_selectedFont;
+ wxFont m_measuringFont;
+ wxPen m_normalBkPen;
+ wxPen m_selectedBkPen;
+ wxBrush m_normalBkBrush;
+ wxBrush m_selectedBkBrush;
+ wxBrush m_bkBrush;
+ wxBitmap m_activeCloseBmp;
+ wxBitmap m_disabledCloseBmp;
+ wxBitmap m_activeLeftBmp;
+ wxBitmap m_disabledLeftBmp;
+ wxBitmap m_activeRightBmp;
+ wxBitmap m_disabledRightBmp;
+ wxBitmap m_activeWindowListBmp;
+ wxBitmap m_disabledWindowListBmp;
+
+ int m_fixedTabWidth;
unsigned int m_flags;
};
bool AddPage(wxWindow* page, const wxAuiNotebookPage& info);
bool InsertPage(wxWindow* page, const wxAuiNotebookPage& info, size_t idx);
- bool MovePage(wxWindow* page, size_t new_idx);
+ bool MovePage(wxWindow* page, size_t newIdx);
bool RemovePage(wxWindow* page);
bool SetActivePage(wxWindow* page);
bool SetActivePage(size_t page);
wxAuiNotebookPage& GetPage(size_t idx);
const wxAuiNotebookPage& GetPage(size_t idx) const;
wxAuiNotebookPageArray& GetPages();
- void SetNormalFont(const wxFont& normal_font);
- void SetSelectedFont(const wxFont& selected_font);
- void SetMeasuringFont(const wxFont& measuring_font);
+ void SetNormalFont(const wxFont& normalFont);
+ void SetSelectedFont(const wxFont& selectedFont);
+ void SetMeasuringFont(const wxFont& measuringFont);
void SetColour(const wxColour& colour);
void SetActiveColour(const wxColour& colour);
void DoShowHide();
void RemoveButton(int id);
void AddButton(int id,
int location,
- const wxBitmap& normal_bitmap = wxNullBitmap,
- const wxBitmap& disabled_bitmap = wxNullBitmap);
+ const wxBitmap& normalBitmap = wxNullBitmap,
+ const wxBitmap& disabledBitmap = wxNullBitmap);
size_t GetTabOffset() const;
void SetTabOffset(size_t offset);
wxAuiTabArt* m_art;
wxAuiNotebookPageArray m_pages;
wxAuiTabContainerButtonArray m_buttons;
- wxAuiTabContainerButtonArray m_tab_close_buttons;
+ wxAuiTabContainerButtonArray m_tabCloseButtons;
wxRect m_rect;
- size_t m_tab_offset;
+ size_t m_tabOffset;
unsigned int m_flags;
};
~wxAuiTabCtrl();
- bool IsDragging() const { return m_is_dragging; }
+ bool IsDragging() const { return m_isDragging; }
protected:
// choose the default border for this window
protected:
- wxPoint m_click_pt;
- wxWindow* m_click_tab;
- bool m_is_dragging;
- wxAuiTabContainerButton* m_hover_button;
- wxAuiTabContainerButton* m_pressed_button;
+ wxPoint m_clickPt;
+ wxWindow* m_clickTab;
+ bool m_isDragging;
+ wxAuiTabContainerButton* m_hoverButton;
+ wxAuiTabContainerButton* m_pressedButton;
#ifndef SWIG
DECLARE_CLASS(wxAuiTabCtrl)
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
- bool InsertPage(size_t page_idx,
+ bool InsertPage(size_t pageIdx,
wxWindow* page,
const wxString& caption,
bool select = false,
bool RemovePage(size_t page);
size_t GetPageCount() const;
- wxWindow* GetPage(size_t page_idx) const;
- int GetPageIndex(wxWindow* page_wnd) const;
+ wxWindow* GetPage(size_t pageIdx) const;
+ int GetPageIndex(wxWindow* pageWnd) const;
bool SetPageText(size_t page, const wxString& text);
- wxString GetPageText(size_t page_idx) const;
+ wxString GetPageText(size_t pageIdx) const;
bool SetPageBitmap(size_t page, const wxBitmap& bitmap);
- wxBitmap GetPageBitmap(size_t page_idx) const;
+ wxBitmap GetPageBitmap(size_t pageIdx) const;
- int SetSelection(size_t new_page);
+ int SetSelection(size_t newPage);
int GetSelection() const;
virtual void Split(size_t page, int direction);
void DoSizing();
void InitNotebook(long style);
wxAuiTabCtrl* GetTabCtrlFromPoint(const wxPoint& pt);
- wxWindow* GetTabFrameFromTabCtrl(wxWindow* tab_ctrl);
+ wxWindow* GetTabFrameFromTabCtrl(wxWindow* tabCtrl);
wxAuiTabCtrl* GetActiveTabCtrl();
bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx);
void RemoveEmptyTabFrames();
wxAuiManager m_mgr;
wxAuiTabContainer m_tabs;
- int m_curpage;
- int m_tab_id_counter;
- wxWindow* m_dummy_wnd;
+ int m_curPage;
+ int m_tabIdCounter;
+ wxWindow* m_dummyWnd;
- wxSize m_requested_bmp_size;
- int m_requested_tabctrl_height;
- wxFont m_selected_font;
- wxFont m_normal_font;
- int m_tab_ctrl_height;
+ wxSize m_requestedBmpSize;
+ int m_requestedTabCtrlHeight;
+ wxFont m_selectedFont;
+ wxFont m_normalFont;
+ int m_tabCtrlHeight;
- int m_last_drag_x;
+ int m_lastDragX;
unsigned int m_flags;
#ifndef SWIG
virtual ~wxAuiDockArt() { }
virtual int GetMetric(int id) = 0;
- virtual void SetMetric(int id, int new_val) = 0;
+ virtual void SetMetric(int id, int newVal) = 0;
virtual void SetFont(int id, const wxFont& font) = 0;
virtual wxFont GetFont(int id) = 0;
virtual wxColour GetColour(int id) = 0;
virtual void DrawPaneButton(wxDC& dc,
wxWindow* window,
int button,
- int button_state,
+ int buttonState,
const wxRect& rect,
wxAuiPaneInfo& pane) = 0;
};
wxAuiDefaultDockArt();
- int GetMetric(int metric_id);
- void SetMetric(int metric_id, int new_val);
+ int GetMetric(int metricId);
+ void SetMetric(int metricId, int newVal);
wxColour GetColour(int id);
void SetColour(int id, const wxColor& colour);
void SetFont(int id, const wxFont& font);
void DrawPaneButton(wxDC& dc,
wxWindow *window,
int button,
- int button_state,
+ int buttonState,
const wxRect& rect,
wxAuiPaneInfo& pane);
protected:
- wxPen m_border_pen;
- wxBrush m_sash_brush;
- wxBrush m_background_brush;
- wxBrush m_gripper_brush;
- wxFont m_caption_font;
- wxBitmap m_inactive_close_bitmap;
- wxBitmap m_inactive_pin_bitmap;
- wxBitmap m_inactive_maximize_bitmap;
- wxBitmap m_inactive_restore_bitmap;
- wxBitmap m_active_close_bitmap;
- wxBitmap m_active_pin_bitmap;
- wxBitmap m_active_maximize_bitmap;
- wxBitmap m_active_restore_bitmap;
- wxPen m_gripper_pen1;
- wxPen m_gripper_pen2;
- wxPen m_gripper_pen3;
- wxColour m_base_colour;
- wxColour m_active_caption_colour;
- wxColour m_active_caption_gradient_colour;
- wxColour m_active_caption_text_colour;
- wxColour m_inactive_caption_colour;
- wxColour m_inactive_caption_gradient_colour;
- wxColour m_inactive_caption_text_colour;
- int m_border_size;
- int m_caption_size;
- int m_sash_size;
- int m_button_size;
- int m_gripper_size;
- int m_gradient_type;
+ wxPen m_borderPen;
+ wxBrush m_sashBrush;
+ wxBrush m_backgroundBrush;
+ wxBrush m_gripperBrush;
+ wxFont m_captionFont;
+ wxBitmap m_inactiveCloseBitmap;
+ wxBitmap m_inactivePinBitmap;
+ wxBitmap m_inactiveMaximizeBitmap;
+ wxBitmap m_inactiveRestoreBitmap;
+ wxBitmap m_activeCloseBitmap;
+ wxBitmap m_activePinBitmap;
+ wxBitmap m_activeMaximizeBitmap;
+ wxBitmap m_activeRestoreBitmap;
+ wxPen m_gripperPen1;
+ wxPen m_gripperPen2;
+ wxPen m_gripperPen3;
+ wxColour m_baseColour;
+ wxColour m_activeCaptionColour;
+ wxColour m_activeCaptionGradientColour;
+ wxColour m_activeCaptionTextColour;
+ wxColour m_inactiveCaptionColour;
+ wxColour m_inactiveCaptionGradientColour;
+ wxColour m_inactiveCaptionTextColour;
+ int m_borderSize;
+ int m_captionSize;
+ int m_sashSize;
+ int m_buttonSize;
+ int m_gripperSize;
+ int m_gradientType;
};
{
public:
wxAuiFloatingFrame(wxWindow* parent,
- wxAuiManager* owner_mgr,
+ wxAuiManager* ownerMgr,
const wxAuiPaneInfo& pane,
wxWindowID id = wxID_ANY,
long style = wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION |
protected:
virtual void OnMoveStart();
- virtual void OnMoving(const wxRect& window_rect, wxDirection dir);
+ virtual void OnMoving(const wxRect& windowRect, wxDirection dir);
virtual void OnMoveFinished();
private:
static bool isMouseDown();
private:
- wxWindow* m_pane_window; // pane window being managed
- bool m_solid_drag; // true if system uses solid window drag
+ wxWindow* m_paneWindow; // pane window being managed
+ bool m_solidDrag; // true if system uses solid window drag
bool m_moving;
- wxRect m_last_rect;
- wxRect m_last2_rect;
- wxRect m_last3_rect;
- wxSize m_last_size;
+ wxRect m_lastRect;
+ wxRect m_last2Rect;
+ wxRect m_last3Rect;
+ wxSize m_lastSize;
wxDirection m_lastDirection;
- wxWeakRef<wxAuiManager> m_owner_mgr;
+ wxWeakRef<wxAuiManager> m_ownerMgr;
wxAuiManager m_mgr;
#ifndef SWIG
public:
- wxAuiManager(wxWindow* managed_wnd = NULL,
+ wxAuiManager(wxWindow* managedWnd = NULL,
unsigned int flags = wxAUI_MGR_DEFAULT);
virtual ~wxAuiManager();
void UnInit();
void SetFlags(unsigned int flags);
unsigned int GetFlags() const;
- void SetManagedWindow(wxWindow* managed_wnd);
+ void SetManagedWindow(wxWindow* managedWnd);
wxWindow* GetManagedWindow() const;
static wxAuiManager* GetManager(wxWindow* window);
- void SetArtProvider(wxAuiDockArt* art_provider);
+ void SetArtProvider(wxAuiDockArt* artProvider);
wxAuiDockArt* GetArtProvider() const;
wxAuiPaneInfo& GetPane(wxWindow* window);
wxAuiPaneInfoArray& GetAllPanes();
bool AddPane(wxWindow* window,
- const wxAuiPaneInfo& pane_info);
+ const wxAuiPaneInfo& paneInfo);
bool AddPane(wxWindow* window,
- const wxAuiPaneInfo& pane_info,
- const wxPoint& drop_pos);
+ const wxAuiPaneInfo& paneInfo,
+ const wxPoint& dropPos);
bool AddPane(wxWindow* window,
int direction = wxLEFT,
const wxString& caption = wxEmptyString);
bool InsertPane(wxWindow* window,
- const wxAuiPaneInfo& insert_location,
- int insert_level = wxAUI_INSERT_PANE);
+ const wxAuiPaneInfo& insertLocation,
+ int insertLevel = wxAUI_INSERT_PANE);
bool DetachPane(wxWindow* window);
void Update();
wxString SavePaneInfo(wxAuiPaneInfo& pane);
- void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane);
+ void LoadPaneInfo(wxString panePart, wxAuiPaneInfo &pane);
wxString SavePerspective();
bool LoadPerspective(const wxString& perspective, bool update = true);
- void SetDockSizeConstraint(double width_pct, double height_pct);
- void GetDockSizeConstraint(double* width_pct, double* height_pct) const;
+ void SetDockSizeConstraint(double widthPct, double heightPct);
+ void GetDockSizeConstraint(double* widthPct, double* heightPct) const;
- void ClosePane(wxAuiPaneInfo& pane_info);
- void MaximizePane(wxAuiPaneInfo& pane_info);
- void RestorePane(wxAuiPaneInfo& pane_info);
+ void ClosePane(wxAuiPaneInfo& paneInfo);
+ void MaximizePane(wxAuiPaneInfo& paneInfo);
+ void RestorePane(wxAuiPaneInfo& paneInfo);
void RestoreMaximizedPane();
public:
virtual bool CanDockPanel(const wxAuiPaneInfo & p);
void StartPaneDrag(
- wxWindow* pane_window,
+ wxWindow* paneWindow,
const wxPoint& offset);
wxRect CalculateHintRect(
- wxWindow* pane_window,
+ wxWindow* paneWindow,
const wxPoint& pt,
const wxPoint& offset);
void DrawHintRect(
- wxWindow* pane_window,
+ wxWindow* paneWindow,
const wxPoint& pt,
const wxPoint& offset);
wxAuiDockInfo& dock,
wxAuiPaneInfo& pane,
wxAuiDockUIPartArray& uiparts,
- bool spacer_only);
+ bool spacerOnly);
void LayoutAddDock(wxSizer* container,
wxAuiDockInfo& dock,
- wxAuiDockUIPartArray& uiparts,
- bool spacer_only);
+ wxAuiDockUIPartArray& uiParts,
+ bool spacerOnly);
wxSizer* LayoutAll(wxAuiPaneInfoArray& panes,
wxAuiDockInfoArray& docks,
- wxAuiDockUIPartArray& uiparts,
- bool spacer_only = false);
+ wxAuiDockUIPartArray & uiParts,
+ bool spacerOnly = false);
virtual bool ProcessDockResult(wxAuiPaneInfo& target,
- const wxAuiPaneInfo& new_pos);
+ const wxAuiPaneInfo& newPos);
bool DoDrop(wxAuiDockInfoArray& docks,
wxAuiPaneInfoArray& panes,
wxAuiPaneInfo& drop,
const wxPoint& pt,
- const wxPoint& action_offset = wxPoint(0,0));
+ const wxPoint& actionOffset = wxPoint(0,0));
wxAuiDockUIPart* HitTest(int x, int y);
wxAuiDockUIPart* GetPanePart(wxWindow* pane);
void Render(wxDC* dc);
void Repaint(wxDC* dc = NULL);
void ProcessMgrEvent(wxAuiManagerEvent& event);
- void UpdateButtonOnScreen(wxAuiDockUIPart* button_ui_part,
+ void UpdateButtonOnScreen(wxAuiDockUIPart* buttonUiPart,
const wxMouseEvent& event);
void GetPanePositionsAndSizes(wxAuiDockInfo& dock,
wxArrayInt& positions,
wxAuiPaneInfoArray m_panes; // array of panes structures
wxAuiDockInfoArray m_docks; // array of docks structures
- wxAuiDockUIPartArray m_uiparts; // array of UI parts (captions, buttons, etc)
+ wxAuiDockUIPartArray m_uiParts; // array of UI parts (captions, buttons, etc)
int m_action; // current mouse action
- wxPoint m_action_start; // position where the action click started
- wxPoint m_action_offset; // offset from upper left of the item clicked
- wxAuiDockUIPart* m_action_part; // ptr to the part the action happened to
- wxWindow* m_action_window; // action frame or window (NULL if none)
- wxRect m_action_hintrect; // hint rectangle for the action
- wxRect m_last_rect;
- wxAuiDockUIPart* m_hover_button;// button uipart being hovered over
- wxRect m_last_hint; // last hint rectangle
- wxPoint m_last_mouse_move; // last mouse move position (see OnMotion)
+ wxPoint m_actionStart; // position where the action click started
+ wxPoint m_actionOffset; // offset from upper left of the item clicked
+ wxAuiDockUIPart* m_actionPart; // ptr to the part the action happened to
+ wxWindow* m_actionWindow; // action frame or window (NULL if none)
+ wxRect m_actionHintRect; // hint rectangle for the action
+ wxRect m_lastRect;
+ wxAuiDockUIPart* m_hoverButton;// button uipart being hovered over
+ wxRect m_lastHint; // last hint rectangle
+ wxPoint m_lastMouseMove; // last mouse move position (see OnMotion)
int m_currentDragItem;
bool m_skipping;
- bool m_has_maximized;
+ bool m_hasMaximized;
- double m_dock_constraint_x; // 0.0 .. 1.0; max pct of window width a dock can consume
- double m_dock_constraint_y; // 0.0 .. 1.0; max pct of window height a dock can consume
+ double m_dockConstraintX; // 0.0 .. 1.0; max pct of window width a dock can consume
+ double m_dockConstraintY; // 0.0 .. 1.0; max pct of window height a dock can consume
- wxFrame* m_hint_wnd; // transparent hint window, if supported by platform
- wxTimer m_hint_fadetimer; // transparent fade timer
- wxByte m_hint_fadeamt; // transparent fade amount
- wxByte m_hint_fademax; // maximum value of hint fade
+ wxFrame* m_hintWnd; // transparent hint window, if supported by platform
+ wxTimer m_hintFadeTimer; // transparent fade timer
+ wxByte m_hintFadeAmt; // transparent fade amount
+ wxByte m_hintFadeMax; // maximum value of hint fade
void* m_reserved;
const wxString& name = wxFrameNameStr);
#if wxUSE_MENUS
- virtual void SetMenuBar(wxMenuBar *menu_bar);
+ virtual void SetMenuBar(wxMenuBar *menuBar);
virtual wxMenuBar *GetMenuBar() const;
#endif // wxUSE_MENUS
protected:
void Init();
- virtual void DoSetSize(int x, int y, int width, int height, int size_flags);
+ virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
virtual void DoMoveWindow(int x, int y, int width, int height);
// no size hints
protected:
wxAuiMDIParentFrame* m_pMDIParentFrame;
- wxRect m_mdi_newrect;
- wxRect m_mdi_currect;
+ wxRect m_mdiNewRect;
+ wxRect m_mdiCurRect;
wxString m_title;
wxIcon m_icon;
- wxIconBundle m_icon_bundle;
- bool m_activate_on_create;
+ wxIconBundle m_iconBundle;
+ bool m_activateOnCreate;
#if wxUSE_MENUS
wxMenuBar* m_pMenuBar;
protected:
- void PageChanged(int old_selection, int new_selection);
+ void PageChanged(int oldSelection, int newSelection);
void OnPageClose(wxAuiNotebookEvent& evt);
void OnPageChanged(wxAuiNotebookEvent& evt);
void OnSize(wxSizeEvent& evt);
{
#if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
- wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
+ wxColor baseColour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
#else
- wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
+ wxColor baseColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
#endif
- // the base_colour is too pale to use as our base colour,
+ // the baseColour is too pale to use as our base colour,
// so darken it a bit --
- if ((255-base_colour.Red()) +
- (255-base_colour.Green()) +
- (255-base_colour.Blue()) < 60)
+ if ((255-baseColour.Red()) +
+ (255-baseColour.Green()) +
+ (255-baseColour.Blue()) < 60)
{
- base_colour = base_colour.ChangeLightness(92);
+ baseColour = baseColour.ChangeLightness(92);
}
- return base_colour;
+ return baseColour;
}
{
public:
- ToolbarCommandCapture() { m_last_id = 0; }
- int GetCommandId() const { return m_last_id; }
+ ToolbarCommandCapture() { m_lastId = 0; }
+ int GetCommandId() const { return m_lastId; }
bool ProcessEvent(wxEvent& evt)
{
if (evt.GetEventType() == wxEVT_COMMAND_MENU_SELECTED)
{
- m_last_id = evt.GetId();
+ m_lastId = evt.GetId();
return true;
}
}
private:
- int m_last_id;
+ int m_lastId;
};
wxAuiDefaultToolBarArt::wxAuiDefaultToolBarArt()
{
- m_base_colour = GetBaseColor();
+ m_baseColour = GetBaseColor();
m_flags = 0;
- m_text_orientation = wxAUI_TBTOOL_TEXT_BOTTOM;
- m_highlight_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
+ m_textOrientation = wxAUI_TBTOOL_TEXT_BOTTOM;
+ m_highlightColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
- m_separator_size = 7;
- m_gripper_size = 7;
- m_overflow_size = 16;
+ m_separatorSize = 7;
+ m_gripperSize = 7;
+ m_overflowSize = 16;
- wxColor darker1_colour = m_base_colour.ChangeLightness(85);
- wxColor darker2_colour = m_base_colour.ChangeLightness(75);
- wxColor darker3_colour = m_base_colour.ChangeLightness(60);
- wxColor darker4_colour = m_base_colour.ChangeLightness(50);
- wxColor darker5_colour = m_base_colour.ChangeLightness(40);
+ wxColor darker1Colour = m_baseColour.ChangeLightness(85);
+ wxColor darker2Colour = m_baseColour.ChangeLightness(75);
+ wxColor darker3Colour = m_baseColour.ChangeLightness(60);
+ wxColor darker4Colour = m_baseColour.ChangeLightness(50);
+ wxColor darker5Colour = m_baseColour.ChangeLightness(40);
- m_gripper_pen1 = wxPen(darker5_colour);
- m_gripper_pen2 = wxPen(darker3_colour);
- m_gripper_pen3 = *wxWHITE_PEN;
+ m_gripperPen1 = wxPen(darker5Colour);
+ m_gripperPen2 = wxPen(darker3Colour);
+ m_gripperPen3 = *wxWHITE_PEN;
- static const unsigned char button_dropdown_bits[] = { 0xe0, 0xf1, 0xfb };
- static const unsigned char overflow_bits[] = { 0x80, 0xff, 0x80, 0xc1, 0xe3, 0xf7 };
+ static const unsigned char buttonDropdownBits[] = { 0xe0, 0xf1, 0xfb };
+ static const unsigned char overflowBits[] = { 0x80, 0xff, 0x80, 0xc1, 0xe3, 0xf7 };
- m_button_dropdown_bmp = wxAuiBitmapFromBits(button_dropdown_bits, 5, 3,
+ m_buttonDropDownBmp = wxAuiBitmapFromBits(buttonDropdownBits, 5, 3,
*wxBLACK);
- m_disabled_button_dropdown_bmp = wxAuiBitmapFromBits(
- button_dropdown_bits, 5, 3,
+ m_disabledButtonDropDownBmp = wxAuiBitmapFromBits(
+ buttonDropdownBits, 5, 3,
wxColor(128,128,128));
- m_overflow_bmp = wxAuiBitmapFromBits(overflow_bits, 7, 6, *wxBLACK);
- m_disabled_overflow_bmp = wxAuiBitmapFromBits(overflow_bits, 7, 6, wxColor(128,128,128));
+ m_overflowBmp = wxAuiBitmapFromBits(overflowBits, 7, 6, *wxBLACK);
+ m_disabledOverflowBmp = wxAuiBitmapFromBits(overflowBits, 7, 6, wxColor(128,128,128));
m_font = *wxNORMAL_FONT;
}
void wxAuiDefaultToolBarArt::SetTextOrientation(int orientation)
{
- m_text_orientation = orientation;
+ m_textOrientation = orientation;
}
unsigned int wxAuiDefaultToolBarArt::GetFlags()
int wxAuiDefaultToolBarArt::GetTextOrientation()
{
- return m_text_orientation;
+ return m_textOrientation;
}
void wxAuiDefaultToolBarArt::DrawBackground(
{
wxRect rect = _rect;
rect.height++;
- wxColour start_colour = m_base_colour.ChangeLightness(150);
- wxColour end_colour = m_base_colour.ChangeLightness(90);
- dc.GradientFillLinear(rect, start_colour, end_colour, wxSOUTH);
+ wxColour startColour = m_baseColour.ChangeLightness(150);
+ wxColour endColour = m_baseColour.ChangeLightness(90);
+ dc.GradientFillLinear(rect, startColour, endColour, wxSOUTH);
}
void wxAuiDefaultToolBarArt::DrawLabel(
// we only care about the text height here since the text
// will get cropped based on the width of the item
- int text_width = 0, text_height = 0;
- dc.GetTextExtent(wxT("ABCDHgj"), &text_width, &text_height);
+ int textWidth = 0, textHeight = 0;
+ dc.GetTextExtent(wxT("ABCDHgj"), &textWidth, &textHeight);
// set the clipping region
- wxRect clip_rect = rect;
- clip_rect.width -= 1;
- dc.SetClippingRegion(clip_rect);
-
- int text_x, text_y;
- text_x = rect.x + 1;
- text_y = rect.y + (rect.height-text_height)/2;
- dc.DrawText(item.GetLabel(), text_x, text_y);
+ wxRect clipRect = rect;
+ clipRect.width -= 1;
+ dc.SetClippingRegion(clipRect);
+
+ int textX, textY;
+ textX = rect.x + 1;
+ textY = rect.y + (rect.height-textHeight)/2;
+ dc.DrawText(item.GetLabel(), textX, textY);
dc.DestroyClippingRegion();
}
const wxAuiToolBarItem& item,
const wxRect& rect)
{
- int text_width = 0, text_height = 0;
+ int textWidth = 0, textHeight = 0;
if (m_flags & wxAUI_TB_TEXT)
{
int tx, ty;
- dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height);
- text_width = 0;
- dc.GetTextExtent(item.GetLabel(), &text_width, &ty);
+ dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
+ textWidth = 0;
+ dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
}
- int bmp_x = 0, bmp_y = 0;
- int text_x = 0, text_y = 0;
+ int bmpX = 0, bmpY = 0;
+ int textX = 0, textY = 0;
- if (m_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM)
+ if (m_textOrientation == wxAUI_TBTOOL_TEXT_BOTTOM)
{
- bmp_x = rect.x +
+ bmpX = rect.x +
(rect.width/2) -
(item.GetBitmap().GetWidth()/2);
- bmp_y = rect.y +
- ((rect.height-text_height)/2) -
+ bmpY = rect.y +
+ ((rect.height-textHeight)/2) -
(item.GetBitmap().GetHeight()/2);
- text_x = rect.x + (rect.width/2) - (text_width/2) + 1;
- text_y = rect.y + rect.height - text_height - 1;
+ textX = rect.x + (rect.width/2) - (textWidth/2) + 1;
+ textY = rect.y + rect.height - textHeight - 1;
}
- else if (m_text_orientation == wxAUI_TBTOOL_TEXT_RIGHT)
+ else if (m_textOrientation == wxAUI_TBTOOL_TEXT_RIGHT)
{
- bmp_x = rect.x + 3;
+ bmpX = rect.x + 3;
- bmp_y = rect.y +
+ bmpY = rect.y +
(rect.height/2) -
(item.GetBitmap().GetHeight()/2);
- text_x = bmp_x + 3 + item.GetBitmap().GetWidth();
- text_y = rect.y +
+ textX = bmpX + 3 + item.GetBitmap().GetWidth();
+ textY = rect.y +
(rect.height/2) -
- (text_height/2);
+ (textHeight/2);
}
{
if (item.GetState() & wxAUI_BUTTON_STATE_PRESSED)
{
- dc.SetPen(wxPen(m_highlight_colour));
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(150)));
+ dc.SetPen(wxPen(m_highlightColour));
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(150)));
dc.DrawRectangle(rect);
}
else if ((item.GetState() & wxAUI_BUTTON_STATE_HOVER) || item.IsSticky())
{
- dc.SetPen(wxPen(m_highlight_colour));
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(170)));
+ dc.SetPen(wxPen(m_highlightColour));
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(170)));
// draw an even lighter background for checked item hovers (since
// the hover background is the same color as the check background)
if (item.GetState() & wxAUI_BUTTON_STATE_CHECKED)
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(180)));
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(180)));
dc.DrawRectangle(rect);
}
{
// it's important to put this code in an else statment after the
// hover, otherwise hovers won't draw properly for checked items
- dc.SetPen(wxPen(m_highlight_colour));
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(170)));
+ dc.SetPen(wxPen(m_highlightColour));
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(170)));
dc.DrawRectangle(rect);
}
}
bmp = item.GetBitmap();
if ( bmp.IsOk() )
- dc.DrawBitmap(bmp, bmp_x, bmp_y, true);
+ dc.DrawBitmap(bmp, bmpX, bmpY, true);
// set the item's text color based on if it is disabled
dc.SetTextForeground(*wxBLACK);
if ( (m_flags & wxAUI_TB_TEXT) && !item.GetLabel().empty() )
{
- dc.DrawText(item.GetLabel(), text_x, text_y);
+ dc.DrawText(item.GetLabel(), textX, textY);
}
}
const wxAuiToolBarItem& item,
const wxRect& rect)
{
- int text_width = 0, text_height = 0, text_x = 0, text_y = 0;
- int bmp_x = 0, bmp_y = 0, dropbmp_x = 0, dropbmp_y = 0;
+ int textWidth = 0, textHeight = 0, textX = 0, textY = 0;
+ int bmpX = 0, bmpY = 0, dropBmpX = 0, dropBmpY = 0;
- wxRect button_rect = wxRect(rect.x,
+ wxRect buttonRect = wxRect(rect.x,
rect.y,
rect.width-BUTTON_DROPDOWN_WIDTH,
rect.height);
- wxRect dropdown_rect = wxRect(rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1,
+ wxRect dropDownRect = wxRect(rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1,
rect.y,
BUTTON_DROPDOWN_WIDTH+1,
rect.height);
int tx, ty;
if (m_flags & wxAUI_TB_TEXT)
{
- dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height);
- text_width = 0;
+ dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
+ textWidth = 0;
}
- dc.GetTextExtent(item.GetLabel(), &text_width, &ty);
+ dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
}
- dropbmp_x = dropdown_rect.x +
- (dropdown_rect.width/2) -
- (m_button_dropdown_bmp.GetWidth()/2);
- dropbmp_y = dropdown_rect.y +
- (dropdown_rect.height/2) -
- (m_button_dropdown_bmp.GetHeight()/2);
+ dropBmpX = dropDownRect.x +
+ (dropDownRect.width/2) -
+ (m_buttonDropDownBmp.GetWidth()/2);
+ dropBmpY = dropDownRect.y +
+ (dropDownRect.height/2) -
+ (m_buttonDropDownBmp.GetHeight()/2);
- if (m_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM)
+ if (m_textOrientation == wxAUI_TBTOOL_TEXT_BOTTOM)
{
- bmp_x = button_rect.x +
- (button_rect.width/2) -
+ bmpX = buttonRect.x +
+ (buttonRect.width/2) -
(item.GetBitmap().GetWidth()/2);
- bmp_y = button_rect.y +
- ((button_rect.height-text_height)/2) -
+ bmpY = buttonRect.y +
+ ((buttonRect.height-textHeight)/2) -
(item.GetBitmap().GetHeight()/2);
- text_x = rect.x + (rect.width/2) - (text_width/2) + 1;
- text_y = rect.y + rect.height - text_height - 1;
+ textX = rect.x + (rect.width/2) - (textWidth/2) + 1;
+ textY = rect.y + rect.height - textHeight - 1;
}
- else if (m_text_orientation == wxAUI_TBTOOL_TEXT_RIGHT)
+ else if (m_textOrientation == wxAUI_TBTOOL_TEXT_RIGHT)
{
- bmp_x = rect.x + 3;
+ bmpX = rect.x + 3;
- bmp_y = rect.y +
+ bmpY = rect.y +
(rect.height/2) -
(item.GetBitmap().GetHeight()/2);
- text_x = bmp_x + 3 + item.GetBitmap().GetWidth();
- text_y = rect.y +
+ textX = bmpX + 3 + item.GetBitmap().GetWidth();
+ textY = rect.y +
(rect.height/2) -
- (text_height/2);
+ (textHeight/2);
}
if (item.GetState() & wxAUI_BUTTON_STATE_PRESSED)
{
- dc.SetPen(wxPen(m_highlight_colour));
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(140)));
- dc.DrawRectangle(button_rect);
+ dc.SetPen(wxPen(m_highlightColour));
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(140)));
+ dc.DrawRectangle(buttonRect);
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(170)));
- dc.DrawRectangle(dropdown_rect);
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(170)));
+ dc.DrawRectangle(dropDownRect);
}
else if (item.GetState() & wxAUI_BUTTON_STATE_HOVER ||
item.IsSticky())
{
- dc.SetPen(wxPen(m_highlight_colour));
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(170)));
- dc.DrawRectangle(button_rect);
- dc.DrawRectangle(dropdown_rect);
+ dc.SetPen(wxPen(m_highlightColour));
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(170)));
+ dc.DrawRectangle(buttonRect);
+ dc.DrawRectangle(dropDownRect);
}
else if (item.GetState() & wxAUI_BUTTON_STATE_CHECKED)
{
// Notice that this branch must come after the hover one to ensure the
- // correct appearance when the mouse hovers over a checked item.
- dc.SetPen(wxPen(m_highlight_colour));
- dc.SetBrush(wxBrush(m_highlight_colour.ChangeLightness(170)));
- dc.DrawRectangle(button_rect);
- dc.DrawRectangle(dropdown_rect);
+ // correct appearance when the mouse hovers over a checked item.m_
+ dc.SetPen(wxPen(m_highlightColour));
+ dc.SetBrush(wxBrush(m_highlightColour.ChangeLightness(170)));
+ dc.DrawRectangle(buttonRect);
+ dc.DrawRectangle(dropDownRect);
}
wxBitmap bmp;
if (item.GetState() & wxAUI_BUTTON_STATE_DISABLED)
{
bmp = item.GetDisabledBitmap();
- dropbmp = m_disabled_button_dropdown_bmp;
+ dropbmp = m_disabledButtonDropDownBmp;
}
else
{
bmp = item.GetBitmap();
- dropbmp = m_button_dropdown_bmp;
+ dropbmp = m_buttonDropDownBmp;
}
if (!bmp.IsOk())
return;
- dc.DrawBitmap(bmp, bmp_x, bmp_y, true);
- dc.DrawBitmap(dropbmp, dropbmp_x, dropbmp_y, true);
+ dc.DrawBitmap(bmp, bmpX, bmpY, true);
+ dc.DrawBitmap(dropbmp, dropBmpX, dropBmpY, true);
// set the item's text color based on if it is disabled
dc.SetTextForeground(*wxBLACK);
if ( (m_flags & wxAUI_TB_TEXT) && !item.GetLabel().empty() )
{
- dc.DrawText(item.GetLabel(), text_x, text_y);
+ dc.DrawText(item.GetLabel(), textX, textY);
}
}
if (!(m_flags & wxAUI_TB_TEXT))
return;
- if (m_text_orientation != wxAUI_TBTOOL_TEXT_BOTTOM)
+ if (m_textOrientation != wxAUI_TBTOOL_TEXT_BOTTOM)
return;
- int text_x = 0, text_y = 0;
- int text_width = 0, text_height = 0;
+ int textX = 0, textY = 0;
+ int textWidth = 0, textHeight = 0;
dc.SetFont(m_font);
int tx, ty;
if (m_flags & wxAUI_TB_TEXT)
{
- dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height);
- text_width = 0;
+ dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
+ textWidth = 0;
}
- dc.GetTextExtent(item.GetLabel(), &text_width, &ty);
+ dc.GetTextExtent(item.GetLabel(), &textWidth, &ty);
// don't draw the label if it is wider than the item width
- if (text_width > rect.width)
+ if (textWidth > rect.width)
return;
// set the label's text color
dc.SetTextForeground(*wxBLACK);
- text_x = rect.x + (rect.width/2) - (text_width/2) + 1;
- text_y = rect.y + rect.height - text_height - 1;
+ textX = rect.x + (rect.width/2) - (textWidth/2) + 1;
+ textY = rect.y + rect.height - textHeight - 1;
if ( (m_flags & wxAUI_TB_TEXT) && !item.GetLabel().empty() )
{
- dc.DrawText(item.GetLabel(), text_x, text_y);
+ dc.DrawText(item.GetLabel(), textX, textY);
}
}
dc.SetFont(m_font);
int tx, ty;
- if (m_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM)
+ if (m_textOrientation == wxAUI_TBTOOL_TEXT_BOTTOM)
{
dc.GetTextExtent(wxT("ABCDHgj"), &tx, &ty);
height += ty;
width = wxMax(width, tx+6);
}
}
- else if ( m_text_orientation == wxAUI_TBTOOL_TEXT_RIGHT &&
+ else if ( m_textOrientation == wxAUI_TBTOOL_TEXT_RIGHT &&
!item.GetLabel().empty() )
{
width += 3; // space between left border and bitmap
rect.width = new_width;
}
- wxColour start_colour = m_base_colour.ChangeLightness(80);
- wxColour end_colour = m_base_colour.ChangeLightness(80);
- dc.GradientFillLinear(rect, start_colour, end_colour, horizontal ? wxSOUTH : wxEAST);
+ wxColour startColour = m_baseColour.ChangeLightness(80);
+ wxColour endColour = m_baseColour.ChangeLightness(80);
+ dc.GradientFillLinear(rect, startColour, endColour, horizontal ? wxSOUTH : wxEAST);
}
void wxAuiDefaultToolBarArt::DrawGripper(wxDC& dc,
break;
}
- dc.SetPen(m_gripper_pen1);
+ dc.SetPen(m_gripperPen1);
dc.DrawPoint(x, y);
- dc.SetPen(m_gripper_pen2);
+ dc.SetPen(m_gripperPen2);
dc.DrawPoint(x, y+1);
dc.DrawPoint(x+1, y);
- dc.SetPen(m_gripper_pen3);
+ dc.SetPen(m_gripperPen3);
dc.DrawPoint(x+2, y+1);
dc.DrawPoint(x+2, y+2);
dc.DrawPoint(x+1, y+2);
state & wxAUI_BUTTON_STATE_PRESSED)
{
wxRect cli_rect = wnd->GetClientRect();
- wxColor light_gray_bg = m_highlight_colour.ChangeLightness(170);
+ wxColor light_gray_bg = m_highlightColour.ChangeLightness(170);
if (m_flags & wxAUI_TB_VERTICAL)
{
- dc.SetPen(wxPen(m_highlight_colour));
+ dc.SetPen(wxPen(m_highlightColour));
dc.DrawLine(rect.x, rect.y, rect.x+rect.width, rect.y);
dc.SetPen(wxPen(light_gray_bg));
dc.SetBrush(wxBrush(light_gray_bg));
}
else
{
- dc.SetPen(wxPen(m_highlight_colour));
+ dc.SetPen(wxPen(m_highlightColour));
dc.DrawLine(rect.x, rect.y, rect.x, rect.y+rect.height);
dc.SetPen(wxPen(light_gray_bg));
dc.SetBrush(wxBrush(light_gray_bg));
}
}
- int x = rect.x+1+(rect.width-m_overflow_bmp.GetWidth())/2;
- int y = rect.y+1+(rect.height-m_overflow_bmp.GetHeight())/2;
- dc.DrawBitmap(m_overflow_bmp, x, y, true);
+ int x = rect.x+1+(rect.width-m_overflowBmp.GetWidth())/2;
+ int y = rect.y+1+(rect.height-m_overflowBmp.GetHeight())/2;
+ dc.DrawBitmap(m_overflowBmp, x, y, true);
}
int wxAuiDefaultToolBarArt::GetElementSize(int element_id)
{
switch (element_id)
{
- case wxAUI_TBART_SEPARATOR_SIZE: return m_separator_size;
- case wxAUI_TBART_GRIPPER_SIZE: return m_gripper_size;
- case wxAUI_TBART_OVERFLOW_SIZE: return m_overflow_size;
+ case wxAUI_TBART_SEPARATOR_SIZE: return m_separatorSize;
+ case wxAUI_TBART_GRIPPER_SIZE: return m_gripperSize;
+ case wxAUI_TBART_OVERFLOW_SIZE: return m_overflowSize;
default: return 0;
}
}
{
switch (element_id)
{
- case wxAUI_TBART_SEPARATOR_SIZE: m_separator_size = size; break;
- case wxAUI_TBART_GRIPPER_SIZE: m_gripper_size = size; break;
- case wxAUI_TBART_OVERFLOW_SIZE: m_overflow_size = size; break;
+ case wxAUI_TBART_SEPARATOR_SIZE: m_separatorSize = size; break;
+ case wxAUI_TBART_GRIPPER_SIZE: m_gripperSize = size; break;
+ case wxAUI_TBART_OVERFLOW_SIZE: m_overflowSize = size; break;
}
}
style | wxBORDER_NONE)
{
m_sizer = new wxBoxSizer(wxHORIZONTAL);
- m_button_width = -1;
- m_button_height = -1;
- m_sizer_element_count = 0;
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
- m_tip_item = NULL;
+ m_buttonWidth = -1;
+ m_buttonHeight = -1;
+ m_sizerElementCount = 0;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
+ m_tipItem = NULL;
m_art = new wxAuiDefaultToolBarArt;
- m_tool_packing = 2;
- m_tool_border_padding = 3;
- m_tool_text_orientation = wxAUI_TBTOOL_TEXT_BOTTOM;
- m_gripper_sizer_item = NULL;
- m_overflow_sizer_item = NULL;
+ m_toolPacking = 2;
+ m_toolBorderPadding = 3;
+ m_toolTextOrientation = wxAUI_TBTOOL_TEXT_BOTTOM;
+ m_gripperSizerItem = NULL;
+ m_overflowSizerItem = NULL;
m_dragging = false;
m_orientation = GetOrientation(style);
if (m_orientation == wxBOTH)
m_orientation = wxHORIZONTAL;
}
m_style = style | wxBORDER_NONE;
- m_gripper_visible = (m_style & wxAUI_TB_GRIPPER) ? true : false;
- m_overflow_visible = (m_style & wxAUI_TB_OVERFLOW) ? true : false;
- m_overflow_state = 0;
+ m_gripperVisible = (m_style & wxAUI_TB_GRIPPER) ? true : false;
+ m_overflowVisible = (m_style & wxAUI_TB_OVERFLOW) ? true : false;
+ m_overflowState = 0;
SetMargins(5, 5, 2, 2);
SetFont(*wxNORMAL_FONT);
SetArtFlags();
}
if (m_style & wxAUI_TB_GRIPPER)
- m_gripper_visible = true;
+ m_gripperVisible = true;
else
- m_gripper_visible = false;
+ m_gripperVisible = false;
if (m_style & wxAUI_TB_OVERFLOW)
- m_overflow_visible = true;
+ m_overflowVisible = true;
else
- m_overflow_visible = false;
+ m_overflowVisible = false;
if (style & wxAUI_TB_HORZ_LAYOUT)
SetToolTextOrientation(wxAUI_TBTOOL_TEXT_RIGHT);
if (m_art)
{
SetArtFlags();
- m_art->SetTextOrientation(m_tool_text_orientation);
+ m_art->SetTextOrientation(m_toolTextOrientation);
}
}
wxAuiToolBarItem* wxAuiToolBar::AddTool(int tool_id,
const wxString& label,
const wxBitmap& bitmap,
- const wxString& short_help_string,
+ const wxString& shortHelp_string,
wxItemKind kind)
{
return AddTool(tool_id,
bitmap,
wxNullBitmap,
kind,
- short_help_string,
+ shortHelp_string,
wxEmptyString,
NULL);
}
wxAuiToolBarItem* wxAuiToolBar::AddTool(int tool_id,
const wxString& label,
const wxBitmap& bitmap,
- const wxBitmap& disabled_bitmap,
+ const wxBitmap& disabledBitmap,
wxItemKind kind,
- const wxString& short_help_string,
- const wxString& long_help_string,
+ const wxString& shortHelpString,
+ const wxString& longHelpString,
wxObject* WXUNUSED(client_data))
{
wxAuiToolBarItem item;
- item.window = NULL;
- item.label = label;
- item.bitmap = bitmap;
- item.disabled_bitmap = disabled_bitmap;
- item.short_help = short_help_string;
- item.long_help = long_help_string;
- item.active = true;
- item.dropdown = false;
- item.spacer_pixels = 0;
- item.toolid = tool_id;
- item.state = 0;
- item.proportion = 0;
- item.kind = kind;
- item.sizer_item = NULL;
- item.min_size = wxDefaultSize;
- item.user_data = 0;
- item.sticky = false;
-
- if (item.toolid == wxID_ANY)
- item.toolid = wxNewId();
-
- if (!item.disabled_bitmap.IsOk())
+ item.m_window = NULL;
+ item.m_label = label;
+ item.m_bitmap = bitmap;
+ item.m_disabledBitmap = disabledBitmap;
+ item.m_shortHelp = shortHelpString;
+ item.m_longHelp = longHelpString;
+ item.m_active = true;
+ item.m_dropDown = false;
+ item.m_spacerPixels = 0;
+ item.m_toolId = tool_id;
+ item.m_state = 0;
+ item.m_proportion = 0;
+ item.m_kind = kind;
+ item.m_sizerItem = NULL;
+ item.m_minSize = wxDefaultSize;
+ item.m_userData = 0;
+ item.m_sticky = false;
+
+ if (item.m_toolId == wxID_ANY)
+ item.m_toolId = wxNewId();
+
+ if (!item.m_disabledBitmap.IsOk())
{
// no disabled bitmap specified, we need to make one
- if (item.bitmap.IsOk())
+ if (item.m_bitmap.IsOk())
{
- item.disabled_bitmap = item.bitmap.ConvertToDisabled();
+ item.m_disabledBitmap = item.m_bitmap.ConvertToDisabled();
}
}
m_items.Add(item);
const wxString& label)
{
wxAuiToolBarItem item;
- item.window = (wxWindow*)control;
- item.label = label;
- item.bitmap = wxNullBitmap;
- item.disabled_bitmap = wxNullBitmap;
- item.active = true;
- item.dropdown = false;
- item.spacer_pixels = 0;
- item.toolid = control->GetId();
- item.state = 0;
- item.proportion = 0;
- item.kind = wxITEM_CONTROL;
- item.sizer_item = NULL;
- item.min_size = control->GetEffectiveMinSize();
- item.user_data = 0;
- item.sticky = false;
+ item.m_window = (wxWindow*)control;
+ item.m_label = label;
+ item.m_bitmap = wxNullBitmap;
+ item.m_disabledBitmap = wxNullBitmap;
+ item.m_active = true;
+ item.m_dropDown = false;
+ item.m_spacerPixels = 0;
+ item.m_toolId = control->GetId();
+ item.m_state = 0;
+ item.m_proportion = 0;
+ item.m_kind = wxITEM_CONTROL;
+ item.m_sizerItem = NULL;
+ item.m_minSize = control->GetEffectiveMinSize();
+ item.m_userData = 0;
+ item.m_sticky = false;
m_items.Add(item);
return &m_items.Last();
min_size.x = width;
wxAuiToolBarItem item;
- item.window = NULL;
- item.label = label;
- item.bitmap = wxNullBitmap;
- item.disabled_bitmap = wxNullBitmap;
- item.active = true;
- item.dropdown = false;
- item.spacer_pixels = 0;
- item.toolid = tool_id;
- item.state = 0;
- item.proportion = 0;
- item.kind = wxITEM_LABEL;
- item.sizer_item = NULL;
- item.min_size = min_size;
- item.user_data = 0;
- item.sticky = false;
-
- if (item.toolid == wxID_ANY)
- item.toolid = wxNewId();
+ item.m_window = NULL;
+ item.m_label = label;
+ item.m_bitmap = wxNullBitmap;
+ item.m_disabledBitmap = wxNullBitmap;
+ item.m_active = true;
+ item.m_dropDown = false;
+ item.m_spacerPixels = 0;
+ item.m_toolId = tool_id;
+ item.m_state = 0;
+ item.m_proportion = 0;
+ item.m_kind = wxITEM_LABEL;
+ item.m_sizerItem = NULL;
+ item.m_minSize = min_size;
+ item.m_userData = 0;
+ item.m_sticky = false;
+
+ if (item.m_toolId == wxID_ANY)
+ item.m_toolId = wxNewId();
m_items.Add(item);
return &m_items.Last();
wxAuiToolBarItem* wxAuiToolBar::AddSeparator()
{
wxAuiToolBarItem item;
- item.window = NULL;
- item.label = wxEmptyString;
- item.bitmap = wxNullBitmap;
- item.disabled_bitmap = wxNullBitmap;
- item.active = true;
- item.dropdown = false;
- item.toolid = -1;
- item.state = 0;
- item.proportion = 0;
- item.kind = wxITEM_SEPARATOR;
- item.sizer_item = NULL;
- item.min_size = wxDefaultSize;
- item.user_data = 0;
- item.sticky = false;
+ item.m_window = NULL;
+ item.m_label = wxEmptyString;
+ item.m_bitmap = wxNullBitmap;
+ item.m_disabledBitmap = wxNullBitmap;
+ item.m_active = true;
+ item.m_dropDown = false;
+ item.m_toolId = -1;
+ item.m_state = 0;
+ item.m_proportion = 0;
+ item.m_kind = wxITEM_SEPARATOR;
+ item.m_sizerItem = NULL;
+ item.m_minSize = wxDefaultSize;
+ item.m_userData = 0;
+ item.m_sticky = false;
m_items.Add(item);
return &m_items.Last();
wxAuiToolBarItem* wxAuiToolBar::AddSpacer(int pixels)
{
wxAuiToolBarItem item;
- item.window = NULL;
- item.label = wxEmptyString;
- item.bitmap = wxNullBitmap;
- item.disabled_bitmap = wxNullBitmap;
- item.active = true;
- item.dropdown = false;
- item.spacer_pixels = pixels;
- item.toolid = -1;
- item.state = 0;
- item.proportion = 0;
- item.kind = wxITEM_SPACER;
- item.sizer_item = NULL;
- item.min_size = wxDefaultSize;
- item.user_data = 0;
- item.sticky = false;
+ item.m_window = NULL;
+ item.m_label = wxEmptyString;
+ item.m_bitmap = wxNullBitmap;
+ item.m_disabledBitmap = wxNullBitmap;
+ item.m_active = true;
+ item.m_dropDown = false;
+ item.m_spacerPixels = pixels;
+ item.m_toolId = -1;
+ item.m_state = 0;
+ item.m_proportion = 0;
+ item.m_kind = wxITEM_SPACER;
+ item.m_sizerItem = NULL;
+ item.m_minSize = wxDefaultSize;
+ item.m_userData = 0;
+ item.m_sticky = false;
m_items.Add(item);
return &m_items.Last();
wxAuiToolBarItem* wxAuiToolBar::AddStretchSpacer(int proportion)
{
wxAuiToolBarItem item;
- item.window = NULL;
- item.label = wxEmptyString;
- item.bitmap = wxNullBitmap;
- item.disabled_bitmap = wxNullBitmap;
- item.active = true;
- item.dropdown = false;
- item.spacer_pixels = 0;
- item.toolid = -1;
- item.state = 0;
- item.proportion = proportion;
- item.kind = wxITEM_SPACER;
- item.sizer_item = NULL;
- item.min_size = wxDefaultSize;
- item.user_data = 0;
- item.sticky = false;
+ item.m_window = NULL;
+ item.m_label = wxEmptyString;
+ item.m_bitmap = wxNullBitmap;
+ item.m_disabledBitmap = wxNullBitmap;
+ item.m_active = true;
+ item.m_dropDown = false;
+ item.m_spacerPixels = 0;
+ item.m_toolId = -1;
+ item.m_state = 0;
+ item.m_proportion = proportion;
+ item.m_kind = wxITEM_SPACER;
+ item.m_sizerItem = NULL;
+ item.m_minSize = wxDefaultSize;
+ item.m_userData = 0;
+ item.m_sticky = false;
m_items.Add(item);
return &m_items.Last();
void wxAuiToolBar::Clear()
{
m_items.Clear();
- m_sizer_element_count = 0;
+ m_sizerElementCount = 0;
}
bool wxAuiToolBar::DeleteTool(int tool_id)
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.toolid == tool_id)
+ if (item.m_toolId == tool_id)
return &item;
}
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (!item.sizer_item)
+ if (!item.m_sizerItem)
continue;
- wxRect rect = item.sizer_item->GetRect();
+ wxRect rect = item.m_sizerItem->GetRect();
if (rect.Contains(x,y))
{
// if the item doesn't fit on the toolbar, return NULL
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (!item.sizer_item)
+ if (!item.m_sizerItem)
continue;
- wxRect rect = item.sizer_item->GetRect();
+ wxRect rect = item.m_sizerItem->GetRect();
// apply tool packing
if (i+1 < count)
- rect.width += m_tool_packing;
+ rect.width += m_toolPacking;
if (rect.Contains(x,y))
{
if (!item)
return;
- item->proportion = proportion;
+ item->m_proportion = proportion;
}
int wxAuiToolBar::GetToolProportion(int tool_id) const
if (!item)
return 0;
- return item->proportion;
+ return item->m_proportion;
}
void wxAuiToolBar::SetToolSeparation(int separation)
if (!item)
return;
- item->dropdown = dropdown;
+ item->m_dropDown = dropdown;
}
bool wxAuiToolBar::GetToolDropDown(int tool_id) const
if (!item)
return 0;
- return item->dropdown;
+ return item->m_dropDown;
}
void wxAuiToolBar::SetToolSticky(int tool_id, bool sticky)
if (!item)
return;
- if (item->sticky == sticky)
+ if (item->m_sticky == sticky)
return;
- item->sticky = sticky;
+ item->m_sticky = sticky;
Refresh(false);
Update();
if (!item)
return 0;
- return item->sticky;
+ return item->m_sticky;
}
void wxAuiToolBar::SetToolBorderPadding(int padding)
{
- m_tool_border_padding = padding;
+ m_toolBorderPadding = padding;
}
int wxAuiToolBar::GetToolBorderPadding() const
{
- return m_tool_border_padding;
+ return m_toolBorderPadding;
}
void wxAuiToolBar::SetToolTextOrientation(int orientation)
{
- m_tool_text_orientation = orientation;
+ m_toolTextOrientation = orientation;
if (m_art)
{
int wxAuiToolBar::GetToolTextOrientation() const
{
- return m_tool_text_orientation;
+ return m_toolTextOrientation;
}
void wxAuiToolBar::SetToolPacking(int packing)
{
- m_tool_packing = packing;
+ m_toolPacking = packing;
}
int wxAuiToolBar::GetToolPacking() const
{
- return m_tool_packing;
+ return m_toolPacking;
}
void wxAuiToolBar::SetMargins(int left, int right, int top, int bottom)
{
if (left != -1)
- m_left_padding = left;
+ m_leftPadding = left;
if (right != -1)
- m_right_padding = right;
+ m_rightPadding = right;
if (top != -1)
- m_top_padding = top;
+ m_topPadding = top;
if (bottom != -1)
- m_bottom_padding = bottom;
+ m_bottomPadding = bottom;
}
bool wxAuiToolBar::GetGripperVisible() const
{
- return m_gripper_visible;
+ return m_gripperVisible;
}
void wxAuiToolBar::SetGripperVisible(bool visible)
{
- m_gripper_visible = visible;
+ m_gripperVisible = visible;
if (visible)
m_style |= wxAUI_TB_GRIPPER;
else
bool wxAuiToolBar::GetOverflowVisible() const
{
- return m_overflow_visible;
+ return m_overflowVisible;
}
void wxAuiToolBar::SetOverflowVisible(bool visible)
{
- m_overflow_visible = visible;
+ m_overflowVisible = visible;
if (visible)
m_style |= wxAUI_TB_OVERFLOW;
else
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.state & wxAUI_BUTTON_STATE_HOVER)
+ if (item.m_state & wxAUI_BUTTON_STATE_HOVER)
former_hover = &item;
- item.state &= ~wxAUI_BUTTON_STATE_HOVER;
+ item.m_state &= ~wxAUI_BUTTON_STATE_HOVER;
}
if (pitem)
{
- pitem->state |= wxAUI_BUTTON_STATE_HOVER;
+ pitem->m_state |= wxAUI_BUTTON_STATE_HOVER;
}
if (former_hover != pitem)
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.state & wxAUI_BUTTON_STATE_PRESSED)
+ if (item.m_state & wxAUI_BUTTON_STATE_PRESSED)
former_item = &item;
- item.state &= ~wxAUI_BUTTON_STATE_PRESSED;
+ item.m_state &= ~wxAUI_BUTTON_STATE_PRESSED;
}
if (pitem)
{
- pitem->state &= ~wxAUI_BUTTON_STATE_HOVER;
- pitem->state |= wxAUI_BUTTON_STATE_PRESSED;
+ pitem->m_state &= ~wxAUI_BUTTON_STATE_HOVER;
+ pitem->m_state |= wxAUI_BUTTON_STATE_PRESSED;
}
if (former_item != pitem)
void wxAuiToolBar::RefreshOverflowState()
{
- if (!m_overflow_sizer_item)
+ if (!m_overflowSizerItem)
{
- m_overflow_state = 0;
+ m_overflowState = 0;
return;
}
overflow_state = wxAUI_BUTTON_STATE_HOVER;
}
- if (overflow_state != m_overflow_state)
+ if (overflow_state != m_overflowState)
{
- m_overflow_state = overflow_state;
+ m_overflowState = overflow_state;
Refresh(false);
Update();
}
- m_overflow_state = overflow_state;
+ m_overflowState = overflow_state;
}
void wxAuiToolBar::ToggleTool(int tool_id, bool state)
{
wxAuiToolBarItem* tool = FindTool(tool_id);
- if (tool && (tool->kind == wxITEM_CHECK || tool->kind == wxITEM_RADIO))
+ if (tool && (tool->m_kind == wxITEM_CHECK || tool->m_kind == wxITEM_RADIO))
{
- if (tool->kind == wxITEM_RADIO)
+ if (tool->m_kind == wxITEM_RADIO)
{
int i, idx, count;
idx = GetToolIndex(tool_id);
{
for (i = idx + 1; i < count; ++i)
{
- if (m_items[i].kind != wxITEM_RADIO)
+ if (m_items[i].m_kind != wxITEM_RADIO)
break;
- m_items[i].state &= ~wxAUI_BUTTON_STATE_CHECKED;
+ m_items[i].m_state &= ~wxAUI_BUTTON_STATE_CHECKED;
}
for (i = idx - 1; i >= 0; i--)
{
- if (m_items[i].kind != wxITEM_RADIO)
+ if (m_items[i].m_kind != wxITEM_RADIO)
break;
- m_items[i].state &= ~wxAUI_BUTTON_STATE_CHECKED;
+ m_items[i].m_state &= ~wxAUI_BUTTON_STATE_CHECKED;
}
}
- tool->state |= wxAUI_BUTTON_STATE_CHECKED;
+ tool->m_state |= wxAUI_BUTTON_STATE_CHECKED;
}
- else if (tool->kind == wxITEM_CHECK)
+ else if (tool->m_kind == wxITEM_CHECK)
{
if (state == true)
- tool->state |= wxAUI_BUTTON_STATE_CHECKED;
+ tool->m_state |= wxAUI_BUTTON_STATE_CHECKED;
else
- tool->state &= ~wxAUI_BUTTON_STATE_CHECKED;
+ tool->m_state &= ~wxAUI_BUTTON_STATE_CHECKED;
}
}
}
if (tool)
{
- if ( (tool->kind != wxITEM_CHECK) && (tool->kind != wxITEM_RADIO) )
+ if ( (tool->m_kind != wxITEM_CHECK) && (tool->m_kind != wxITEM_RADIO) )
return false;
- return (tool->state & wxAUI_BUTTON_STATE_CHECKED) ? true : false;
+ return (tool->m_state & wxAUI_BUTTON_STATE_CHECKED) ? true : false;
}
return false;
if (tool)
{
if (state == true)
- tool->state &= ~wxAUI_BUTTON_STATE_DISABLED;
+ tool->m_state &= ~wxAUI_BUTTON_STATE_DISABLED;
else
- tool->state |= wxAUI_BUTTON_STATE_DISABLED;
+ tool->m_state |= wxAUI_BUTTON_STATE_DISABLED;
}
}
wxAuiToolBarItem* tool = FindTool(tool_id);
if (tool)
- return (tool->state & wxAUI_BUTTON_STATE_DISABLED) ? false : true;
+ return (tool->m_state & wxAUI_BUTTON_STATE_DISABLED) ? false : true;
return false;
}
if (!tool)
return wxEmptyString;
- return tool->label;
+ return tool->m_label;
}
void wxAuiToolBar::SetToolLabel(int tool_id, const wxString& label)
wxAuiToolBarItem* tool = FindTool(tool_id);
if (tool)
{
- tool->label = label;
+ tool->m_label = label;
}
}
if (!tool)
return wxNullBitmap;
- return tool->bitmap;
+ return tool->m_bitmap;
}
void wxAuiToolBar::SetToolBitmap(int tool_id, const wxBitmap& bitmap)
wxAuiToolBarItem* tool = FindTool(tool_id);
if (tool)
{
- tool->bitmap = bitmap;
+ tool->m_bitmap = bitmap;
}
}
if (!tool)
return wxEmptyString;
- return tool->short_help;
+ return tool->m_shortHelp;
}
void wxAuiToolBar::SetToolShortHelp(int tool_id, const wxString& help_string)
wxAuiToolBarItem* tool = FindTool(tool_id);
if (tool)
{
- tool->short_help = help_string;
+ tool->m_shortHelp = help_string;
}
}
if (!tool)
return wxEmptyString;
- return tool->long_help;
+ return tool->m_longHelp;
}
void wxAuiToolBar::SetToolLongHelp(int tool_id, const wxString& help_string)
wxAuiToolBarItem* tool = FindTool(tool_id);
if (tool)
{
- tool->long_help = help_string;
+ tool->m_longHelp = help_string;
}
}
void wxAuiToolBar::SetCustomOverflowItems(const wxAuiToolBarItemArray& prepend,
const wxAuiToolBarItemArray& append)
{
- m_custom_overflow_prepend = prepend;
- m_custom_overflow_append = append;
+ m_customOverflowPrepend = prepend;
+ m_customOverflowAppend = append;
}
// get size of hint rectangle for a particular dock location
for (i = 0; i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.toolid == tool_id)
+ if (item.m_toolId == tool_id)
return i;
}
if (tool_idx < 0 || tool_idx >= (int)m_items.GetCount())
return false;
- if (!m_items[tool_idx].sizer_item)
+ if (!m_items[tool_idx].m_sizerItem)
return false;
int cli_w, cli_h;
GetClientSize(&cli_w, &cli_h);
- wxRect rect = m_items[tool_idx].sizer_item->GetRect();
+ wxRect rect = m_items[tool_idx].m_sizerItem->GetRect();
if (m_orientation == wxVERTICAL)
{
// take the dropdown size into account
- if (m_overflow_visible)
- cli_h -= m_overflow_sizer_item->GetSize().y;
+ if (m_overflowVisible)
+ cli_h -= m_overflowSizerItem->GetSize().y;
if (rect.y+rect.height < cli_h)
return true;
else
{
// take the dropdown size into account
- if (m_overflow_visible)
- cli_w -= m_overflow_sizer_item->GetSize().x;
+ if (m_overflowVisible)
+ cli_w -= m_overflowSizerItem->GetSize().x;
if (rect.x+rect.width < cli_w)
return true;
wxRect wxAuiToolBar::GetToolRect(int tool_id) const
{
wxAuiToolBarItem* tool = FindTool(tool_id);
- if (tool && tool->sizer_item)
+ if (tool && tool->m_sizerItem)
{
- return tool->sizer_item->GetRect();
+ return tool->m_sizerItem->GetRect();
}
return wxRect();
wxBoxSizer* sizer = new wxBoxSizer(horizontal ? wxHORIZONTAL : wxVERTICAL);
// add gripper area
- int separator_size = m_art->GetElementSize(wxAUI_TBART_SEPARATOR_SIZE);
- int gripper_size = m_art->GetElementSize(wxAUI_TBART_GRIPPER_SIZE);
- if (gripper_size > 0 && m_gripper_visible)
+ int separatorSize = m_art->GetElementSize(wxAUI_TBART_SEPARATOR_SIZE);
+ int gripperSize = m_art->GetElementSize(wxAUI_TBART_GRIPPER_SIZE);
+ if (gripperSize > 0 && m_gripperVisible)
{
if (horizontal)
- m_gripper_sizer_item = sizer->Add(gripper_size, 1, 0, wxEXPAND);
+ m_gripperSizerItem = sizer->Add(gripperSize, 1, 0, wxEXPAND);
else
- m_gripper_sizer_item = sizer->Add(1, gripper_size, 0, wxEXPAND);
+ m_gripperSizerItem = sizer->Add(1, gripperSize, 0, wxEXPAND);
}
else
{
- m_gripper_sizer_item = NULL;
+ m_gripperSizerItem = NULL;
}
// add "left" padding
- if (m_left_padding > 0)
+ if (m_leftPadding > 0)
{
if (horizontal)
- sizer->Add(m_left_padding, 1);
+ sizer->Add(m_leftPadding, 1);
else
- sizer->Add(1, m_left_padding);
+ sizer->Add(1, m_leftPadding);
}
size_t i, count;
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- wxSizerItem* sizer_item = NULL;
+ wxSizerItem* m_sizerItem = NULL;
- switch (item.kind)
+ switch (item.m_kind)
{
case wxITEM_LABEL:
{
wxSize size = m_art->GetLabelSize(dc, this, item);
- sizer_item = sizer->Add(size.x + (m_tool_border_padding*2),
- size.y + (m_tool_border_padding*2),
- item.proportion,
- item.alignment);
+ m_sizerItem = sizer->Add(size.x + (m_toolBorderPadding*2),
+ size.y + (m_toolBorderPadding*2),
+ item.m_proportion,
+ item.m_alignment);
if (i+1 < count)
{
- sizer->AddSpacer(m_tool_packing);
+ sizer->AddSpacer(m_toolPacking);
}
break;
case wxITEM_RADIO:
{
wxSize size = m_art->GetToolSize(dc, this, item);
- sizer_item = sizer->Add(size.x + (m_tool_border_padding*2),
- size.y + (m_tool_border_padding*2),
+ m_sizerItem = sizer->Add(size.x + (m_toolBorderPadding*2),
+ size.y + (m_toolBorderPadding*2),
0,
- item.alignment);
+ item.m_alignment);
// add tool packing
if (i+1 < count)
{
- sizer->AddSpacer(m_tool_packing);
+ sizer->AddSpacer(m_toolPacking);
}
break;
case wxITEM_SEPARATOR:
{
if (horizontal)
- sizer_item = sizer->Add(separator_size, 1, 0, wxEXPAND);
+ m_sizerItem = sizer->Add(separatorSize, 1, 0, wxEXPAND);
else
- sizer_item = sizer->Add(1, separator_size, 0, wxEXPAND);
+ m_sizerItem = sizer->Add(1, separatorSize, 0, wxEXPAND);
// add tool packing
if (i+1 < count)
{
- sizer->AddSpacer(m_tool_packing);
+ sizer->AddSpacer(m_toolPacking);
}
break;
}
case wxITEM_SPACER:
- if (item.proportion > 0)
- sizer_item = sizer->AddStretchSpacer(item.proportion);
+ if (item.m_proportion > 0)
+ m_sizerItem = sizer->AddStretchSpacer(item.m_proportion);
else
- sizer_item = sizer->Add(item.spacer_pixels, 1);
+ m_sizerItem = sizer->Add(item.m_spacerPixels, 1);
break;
case wxITEM_CONTROL:
{
- //sizer_item = sizer->Add(item.window, item.proportion, wxEXPAND);
- wxSizerItem* ctrl_sizer_item;
+ //m_sizerItem = sizer->Add(item.m_window, item.m_proportion, wxEXPAND);
+ wxSizerItem* ctrl_m_sizerItem;
wxBoxSizer* vert_sizer = new wxBoxSizer(wxVERTICAL);
vert_sizer->AddStretchSpacer(1);
- ctrl_sizer_item = vert_sizer->Add(item.window, 0, wxEXPAND);
+ ctrl_m_sizerItem = vert_sizer->Add(item.m_window, 0, wxEXPAND);
vert_sizer->AddStretchSpacer(1);
if ( (m_style & wxAUI_TB_TEXT) &&
- m_tool_text_orientation == wxAUI_TBTOOL_TEXT_BOTTOM &&
+ m_toolTextOrientation == wxAUI_TBTOOL_TEXT_BOTTOM &&
!item.GetLabel().empty() )
{
wxSize s = GetLabelSize(item.GetLabel());
}
- sizer_item = sizer->Add(vert_sizer, item.proportion, wxEXPAND);
+ m_sizerItem = sizer->Add(vert_sizer, item.m_proportion, wxEXPAND);
- wxSize min_size = item.min_size;
+ wxSize min_size = item.m_minSize;
// proportional items will disappear from the toolbar if
// their min width is not set to something really small
- if (item.proportion != 0)
+ if (item.m_proportion != 0)
{
min_size.x = 1;
}
if (min_size.IsFullySpecified())
{
- sizer_item->SetMinSize(min_size);
- ctrl_sizer_item->SetMinSize(min_size);
+ m_sizerItem->SetMinSize(min_size);
+ ctrl_m_sizerItem->SetMinSize(min_size);
}
// add tool packing
if (i+1 < count)
{
- sizer->AddSpacer(m_tool_packing);
+ sizer->AddSpacer(m_toolPacking);
}
}
}
- item.sizer_item = sizer_item;
+ item.m_sizerItem = m_sizerItem;
}
// add "right" padding
- if (m_right_padding > 0)
+ if (m_rightPadding > 0)
{
if (horizontal)
- sizer->Add(m_right_padding, 1);
+ sizer->Add(m_rightPadding, 1);
else
- sizer->Add(1, m_right_padding);
+ sizer->Add(1, m_rightPadding);
}
// add drop down area
- m_overflow_sizer_item = NULL;
+ m_overflowSizerItem = NULL;
if (m_style & wxAUI_TB_OVERFLOW)
{
int overflow_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
- if (overflow_size > 0 && m_overflow_visible)
+ if (overflow_size > 0 && m_overflowVisible)
{
if (horizontal)
- m_overflow_sizer_item = sizer->Add(overflow_size, 1, 0, wxEXPAND);
+ m_overflowSizerItem = sizer->Add(overflow_size, 1, 0, wxEXPAND);
else
- m_overflow_sizer_item = sizer->Add(1, overflow_size, 0, wxEXPAND);
+ m_overflowSizerItem = sizer->Add(1, overflow_size, 0, wxEXPAND);
}
else
{
- m_overflow_sizer_item = NULL;
+ m_overflowSizerItem = NULL;
}
}
wxBoxSizer* outside_sizer = new wxBoxSizer(horizontal ? wxVERTICAL : wxHORIZONTAL);
// add "top" padding
- if (m_top_padding > 0)
+ if (m_topPadding > 0)
{
if (horizontal)
- outside_sizer->Add(1, m_top_padding);
+ outside_sizer->Add(1, m_topPadding);
else
- outside_sizer->Add(m_top_padding, 1);
+ outside_sizer->Add(m_topPadding, 1);
}
// add the sizer that contains all of the toolbar elements
outside_sizer->Add(sizer, 1, wxEXPAND);
// add "bottom" padding
- if (m_bottom_padding > 0)
+ if (m_bottomPadding > 0)
{
if (horizontal)
- outside_sizer->Add(1, m_bottom_padding);
+ outside_sizer->Add(1, m_bottomPadding);
else
- outside_sizer->Add(m_bottom_padding, 1);
+ outside_sizer->Add(m_bottomPadding, 1);
}
delete m_sizer; // remove old sizer
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.sizer_item && item.proportion > 0 && item.min_size.IsFullySpecified())
- item.sizer_item->SetMinSize(0,0);
+ if (item.m_sizerItem && item.m_proportion > 0 && item.m_minSize.IsFullySpecified())
+ item.m_sizerItem->SetMinSize(0,0);
}
- m_absolute_min_size = m_sizer->GetMinSize();
+ m_absoluteMinSize = m_sizer->GetMinSize();
// reset the min sizes to what they were
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.sizer_item && item.proportion > 0 && item.min_size.IsFullySpecified())
- item.sizer_item->SetMinSize(item.min_size);
+ if (item.m_sizerItem && item.m_proportion > 0 && item.m_minSize.IsFullySpecified())
+ item.m_sizerItem->SetMinSize(item.m_minSize);
}
// set control size
if ((m_style & wxAUI_TB_NO_AUTORESIZE) == 0)
{
- wxSize cur_size = GetClientSize();
+ wxSize curSize = GetClientSize();
wxSize new_size = GetMinSize();
- if (new_size != cur_size)
+ if (new_size != curSize)
{
SetClientSize(new_size);
}
else
{
- m_sizer->SetDimension(0, 0, cur_size.x, cur_size.y);
+ m_sizer->SetDimension(0, 0, curSize.x, curSize.y);
}
}
else
{
- wxSize cur_size = GetClientSize();
- m_sizer->SetDimension(0, 0, cur_size.x, cur_size.y);
+ wxSize curSize = GetClientSize();
+ m_sizer->SetDimension(0, 0, curSize.x, curSize.y);
}
return true;
int wxAuiToolBar::GetOverflowState() const
{
- return m_overflow_state;
+ return m_overflowState;
}
wxRect wxAuiToolBar::GetOverflowRect() const
{
wxRect cli_rect(wxPoint(0,0), GetClientSize());
- wxRect overflow_rect = m_overflow_sizer_item->GetRect();
+ wxRect overflow_rect = m_overflowSizerItem->GetRect();
int overflow_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
if (m_orientation == wxVERTICAL)
wxClientDC dc(this);
int tx, ty;
- int text_width = 0, text_height = 0;
+ int textWidth = 0, textHeight = 0;
dc.SetFont(m_font);
// get the text height
- dc.GetTextExtent(wxT("ABCDHgj"), &tx, &text_height);
+ dc.GetTextExtent(wxT("ABCDHgj"), &tx, &textHeight);
// get the text width
- dc.GetTextExtent(label, &text_width, &ty);
+ dc.GetTextExtent(label, &textWidth, &ty);
- return wxSize(text_width, text_height);
+ return wxSize(textWidth, textHeight);
}
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.toolid == -1)
+ if (item.m_toolId == -1)
continue;
- wxUpdateUIEvent evt(item.toolid);
+ wxUpdateUIEvent evt(item.m_toolId);
evt.SetEventObject(this);
if (handler->ProcessEvent(evt))
if (evt.GetSetEnabled())
{
bool is_enabled;
- if (item.window)
- is_enabled = item.window->IsEnabled();
+ if (item.m_window)
+ is_enabled = item.m_window->IsEnabled();
else
- is_enabled = (item.state & wxAUI_BUTTON_STATE_DISABLED) ? false : true;
+ is_enabled = (item.m_state & wxAUI_BUTTON_STATE_DISABLED) ? false : true;
bool new_enabled = evt.GetEnabled();
if (new_enabled != is_enabled)
{
- if (item.window)
+ if (item.m_window)
{
- item.window->Enable(new_enabled);
+ item.m_window->Enable(new_enabled);
}
else
{
if (new_enabled)
- item.state &= ~wxAUI_BUTTON_STATE_DISABLED;
+ item.m_state &= ~wxAUI_BUTTON_STATE_DISABLED;
else
- item.state |= wxAUI_BUTTON_STATE_DISABLED;
+ item.m_state |= wxAUI_BUTTON_STATE_DISABLED;
}
need_refresh = true;
}
if (evt.GetSetChecked())
{
// make sure we aren't checking an item that can't be
- if (item.kind != wxITEM_CHECK && item.kind != wxITEM_RADIO)
+ if (item.m_kind != wxITEM_CHECK && item.m_kind != wxITEM_RADIO)
continue;
- bool is_checked = (item.state & wxAUI_BUTTON_STATE_CHECKED) ? true : false;
+ bool is_checked = (item.m_state & wxAUI_BUTTON_STATE_CHECKED) ? true : false;
bool new_checked = evt.GetChecked();
if (new_checked != is_checked)
{
if (new_checked)
- item.state |= wxAUI_BUTTON_STATE_CHECKED;
+ item.m_state |= wxAUI_BUTTON_STATE_CHECKED;
else
- item.state &= ~wxAUI_BUTTON_STATE_CHECKED;
+ item.m_state &= ~wxAUI_BUTTON_STATE_CHECKED;
need_refresh = true;
}
int x, y;
GetClientSize(&x, &y);
- if (((x >= y) && m_absolute_min_size.x > x) ||
- ((y > x) && m_absolute_min_size.y > y))
+ if (((x >= y) && m_absoluteMinSize.x > x) ||
+ ((y > x) && m_absoluteMinSize.y > y))
{
// hide all flexible items
size_t i, count;
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.sizer_item && item.proportion > 0 && item.sizer_item->IsShown())
+ if (item.m_sizerItem && item.m_proportion > 0 && item.m_sizerItem->IsShown())
{
- item.sizer_item->Show(false);
- item.sizer_item->SetProportion(0);
+ item.m_sizerItem->Show(false);
+ item.m_sizerItem->SetProportion(0);
}
}
}
for (i = 0, count = m_items.GetCount(); i < count; ++i)
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (item.sizer_item && item.proportion > 0 && !item.sizer_item->IsShown())
+ if (item.m_sizerItem && item.m_proportion > 0 && !item.m_sizerItem->IsShown())
{
- item.sizer_item->Show(true);
- item.sizer_item->SetProportion(item.proportion);
+ item.m_sizerItem->Show(true);
+ item.m_sizerItem->SetProportion(item.m_proportion);
}
}
}
m_art->DrawBackground(dc, this, cli_rect);
- int gripper_size = m_art->GetElementSize(wxAUI_TBART_GRIPPER_SIZE);
+ int gripperSize = m_art->GetElementSize(wxAUI_TBART_GRIPPER_SIZE);
int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
// paint the gripper
- if (gripper_size > 0 && m_gripper_sizer_item)
+ if (gripperSize > 0 && m_gripperSizerItem)
{
- wxRect gripper_rect = m_gripper_sizer_item->GetRect();
+ wxRect gripper_rect = m_gripperSizerItem->GetRect();
if (horizontal)
- gripper_rect.width = gripper_size;
+ gripper_rect.width = gripperSize;
else
- gripper_rect.height = gripper_size;
+ gripper_rect.height = gripperSize;
m_art->DrawGripper(dc, this, gripper_rect);
}
last_extent = cli_rect.width;
else
last_extent = cli_rect.height;
- if (m_overflow_visible)
+ if (m_overflowVisible)
last_extent -= dropdown_size;
// paint each individual tool
{
wxAuiToolBarItem& item = m_items.Item(i);
- if (!item.sizer_item)
+ if (!item.m_sizerItem)
continue;
- wxRect item_rect = item.sizer_item->GetRect();
+ wxRect item_rect = item.m_sizerItem->GetRect();
if ((horizontal && item_rect.x + item_rect.width >= last_extent) ||
break;
}
- if (item.kind == wxITEM_SEPARATOR)
+ if (item.m_kind == wxITEM_SEPARATOR)
{
// draw a separator
m_art->DrawSeparator(dc, this, item_rect);
}
- else if (item.kind == wxITEM_LABEL)
+ else if (item.m_kind == wxITEM_LABEL)
{
// draw a text label only
m_art->DrawLabel(dc, this, item, item_rect);
}
- else if (item.kind == wxITEM_NORMAL)
+ else if (item.m_kind == wxITEM_NORMAL)
{
// draw a regular button or dropdown button
- if (!item.dropdown)
+ if (!item.m_dropDown)
m_art->DrawButton(dc, this, item, item_rect);
else
m_art->DrawDropDownButton(dc, this, item, item_rect);
}
- else if (item.kind == wxITEM_CHECK)
+ else if (item.m_kind == wxITEM_CHECK)
{
// draw either a regular or dropdown toggle button
- if (!item.dropdown)
+ if (!item.m_dropDown)
m_art->DrawButton(dc, this, item, item_rect);
else
m_art->DrawDropDownButton(dc, this, item, item_rect);
}
- else if (item.kind == wxITEM_RADIO)
+ else if (item.m_kind == wxITEM_RADIO)
{
// draw a toggle button
m_art->DrawButton(dc, this, item, item_rect);
}
- else if (item.kind == wxITEM_CONTROL)
+ else if (item.m_kind == wxITEM_CONTROL)
{
// draw the control's label
m_art->DrawControlLabel(dc, this, item, item_rect);
}
// paint the overflow button
- if (dropdown_size > 0 && m_overflow_sizer_item)
+ if (dropdown_size > 0 && m_overflowSizerItem)
{
- wxRect dropdown_rect = GetOverflowRect();
- m_art->DrawOverflowButton(dc, this, dropdown_rect, m_overflow_state);
+ wxRect dropDownRect = GetOverflowRect();
+ m_art->DrawOverflowButton(dc, this, dropDownRect, m_overflowState);
}
}
{
wxRect cli_rect(wxPoint(0,0), GetClientSize());
- if (m_gripper_sizer_item)
+ if (m_gripperSizerItem)
{
- wxRect gripper_rect = m_gripper_sizer_item->GetRect();
+ wxRect gripper_rect = m_gripperSizerItem->GetRect();
if (gripper_rect.Contains(evt.GetX(), evt.GetY()))
{
// find aui manager
}
}
- if (m_overflow_sizer_item)
+ if (m_overflowSizerItem)
{
wxRect overflow_rect = GetOverflowRect();
if (m_art &&
- m_overflow_visible &&
+ m_overflowVisible &&
overflow_rect.Contains(evt.m_x, evt.m_y))
{
wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, -1);
// add custom overflow prepend items, if any
- count = m_custom_overflow_prepend.GetCount();
+ count = m_customOverflowPrepend.GetCount();
for (i = 0; i < count; ++i)
- overflow_items.Add(m_custom_overflow_prepend[i]);
+ overflow_items.Add(m_customOverflowPrepend[i]);
// only show items that don't fit in the dropdown
count = m_items.GetCount();
}
// add custom overflow append items, if any
- count = m_custom_overflow_append.GetCount();
+ count = m_customOverflowAppend.GetCount();
for (i = 0; i < count; ++i)
- overflow_items.Add(m_custom_overflow_append[i]);
+ overflow_items.Add(m_customOverflowAppend[i]);
int res = m_art->ShowDropDown(this, overflow_items);
- m_overflow_state = 0;
+ m_overflowState = 0;
Refresh(false);
if (res != -1)
{
}
m_dragging = false;
- m_action_pos = wxPoint(evt.GetX(), evt.GetY());
- m_action_item = FindToolByPosition(evt.GetX(), evt.GetY());
+ m_actionPos = wxPoint(evt.GetX(), evt.GetY());
+ m_actionItem = FindToolByPosition(evt.GetX(), evt.GetY());
- if (m_action_item)
+ if (m_actionItem)
{
- if (m_action_item->state & wxAUI_BUTTON_STATE_DISABLED)
+ if (m_actionItem->m_state & wxAUI_BUTTON_STATE_DISABLED)
{
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
return;
}
UnsetToolTip();
// fire the tool dropdown event
- wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, m_action_item->toolid);
+ wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, m_actionItem->m_toolId);
e.SetEventObject(this);
- e.SetToolId(m_action_item->toolid);
+ e.SetToolId(m_actionItem->m_toolId);
int mouse_x = evt.GetX();
- wxRect rect = m_action_item->sizer_item->GetRect();
- const bool dropDownHit = m_action_item->dropdown &&
+ wxRect rect = m_actionItem->m_sizerItem->GetRect();
+ const bool dropDownHit = m_actionItem->m_dropDown &&
mouse_x >= (rect.x+rect.width-BUTTON_DROPDOWN_WIDTH-1) &&
mouse_x < (rect.x+rect.width);
e.SetDropDownClicked(dropDownHit);
// we only set the 'pressed button' state if we hit the actual button
// and not just the drop-down
- SetPressedItem(dropDownHit ? 0 : m_action_item);
+ SetPressedItem(dropDownHit ? 0 : m_actionItem);
if(dropDownHit)
{
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
}
if(!GetEventHandler()->ProcessEvent(e) || e.GetSkipped())
SetPressedItem(NULL);
- wxAuiToolBarItem* hit_item = FindToolByPosition(evt.GetX(), evt.GetY());
- if (hit_item && !(hit_item->state & wxAUI_BUTTON_STATE_DISABLED))
+ wxAuiToolBarItem* hitItem = FindToolByPosition(evt.GetX(), evt.GetY());
+ if (hitItem && !(hitItem->m_state & wxAUI_BUTTON_STATE_DISABLED))
{
- SetHoverItem(hit_item);
+ SetHoverItem(hitItem);
}
if (m_dragging)
}
else
{
- if (m_action_item && hit_item == m_action_item)
+ if (m_actionItem && hitItem == m_actionItem)
{
UnsetToolTip();
- wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, m_action_item->toolid);
+ wxCommandEvent e(wxEVT_COMMAND_MENU_SELECTED, m_actionItem->m_toolId);
e.SetEventObject(this);
- if (hit_item->kind == wxITEM_CHECK || hit_item->kind == wxITEM_RADIO)
+ if (hitItem->m_kind == wxITEM_CHECK || hitItem->m_kind == wxITEM_RADIO)
{
- const bool toggle = !(m_action_item->state & wxAUI_BUTTON_STATE_CHECKED);
+ const bool toggle = !(m_actionItem->m_state & wxAUI_BUTTON_STATE_CHECKED);
- ToggleTool(m_action_item->toolid, toggle);
+ ToggleTool(m_actionItem->m_toolId, toggle);
// repaint immediately
Refresh(false);
{
wxRect cli_rect(wxPoint(0,0), GetClientSize());
- if (m_gripper_sizer_item)
+ if (m_gripperSizerItem)
{
- wxRect gripper_rect = m_gripper_sizer_item->GetRect();
+ wxRect gripper_rect = m_gripperSizerItem->GetRect();
if (gripper_rect.Contains(evt.GetX(), evt.GetY()))
return;
}
- if (m_overflow_sizer_item)
+ if (m_overflowSizerItem)
{
int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
if (dropdown_size > 0 &&
}
}
- m_action_pos = wxPoint(evt.GetX(), evt.GetY());
- m_action_item = FindToolByPosition(evt.GetX(), evt.GetY());
+ m_actionPos = wxPoint(evt.GetX(), evt.GetY());
+ m_actionItem = FindToolByPosition(evt.GetX(), evt.GetY());
- if (m_action_item && m_action_item->state & wxAUI_BUTTON_STATE_DISABLED)
+ if (m_actionItem && m_actionItem->m_state & wxAUI_BUTTON_STATE_DISABLED)
{
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
return;
}
void wxAuiToolBar::OnRightUp(wxMouseEvent& evt)
{
- wxAuiToolBarItem* hit_item;
- hit_item = FindToolByPosition(evt.GetX(), evt.GetY());
+ wxAuiToolBarItem* hitItem;
+ hitItem = FindToolByPosition(evt.GetX(), evt.GetY());
- if (m_action_item && hit_item == m_action_item)
+ if (m_actionItem && hitItem == m_actionItem)
{
- if (hit_item->kind == wxITEM_NORMAL)
+ if (hitItem->m_kind == wxITEM_NORMAL)
{
- wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, m_action_item->toolid);
+ wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, m_actionItem->m_toolId);
e.SetEventObject(this);
- e.SetToolId(m_action_item->toolid);
- e.SetClickPoint(m_action_pos);
+ e.SetToolId(m_actionItem->m_toolId);
+ e.SetClickPoint(m_actionPos);
GetEventHandler()->ProcessEvent(e);
DoIdleUpdate();
}
wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, -1);
e.SetEventObject(this);
e.SetToolId(-1);
- e.SetClickPoint(m_action_pos);
+ e.SetClickPoint(m_actionPos);
GetEventHandler()->ProcessEvent(e);
DoIdleUpdate();
}
// reset member variables
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
}
void wxAuiToolBar::OnMiddleDown(wxMouseEvent& evt)
{
wxRect cli_rect(wxPoint(0,0), GetClientSize());
- if (m_gripper_sizer_item)
+ if (m_gripperSizerItem)
{
- wxRect gripper_rect = m_gripper_sizer_item->GetRect();
+ wxRect gripper_rect = m_gripperSizerItem->GetRect();
if (gripper_rect.Contains(evt.GetX(), evt.GetY()))
return;
}
- if (m_overflow_sizer_item)
+ if (m_overflowSizerItem)
{
int dropdown_size = m_art->GetElementSize(wxAUI_TBART_OVERFLOW_SIZE);
if (dropdown_size > 0 &&
}
}
- m_action_pos = wxPoint(evt.GetX(), evt.GetY());
- m_action_item = FindToolByPosition(evt.GetX(), evt.GetY());
+ m_actionPos = wxPoint(evt.GetX(), evt.GetY());
+ m_actionItem = FindToolByPosition(evt.GetX(), evt.GetY());
- if (m_action_item)
+ if (m_actionItem)
{
- if (m_action_item->state & wxAUI_BUTTON_STATE_DISABLED)
+ if (m_actionItem->m_state & wxAUI_BUTTON_STATE_DISABLED)
{
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
return;
}
}
void wxAuiToolBar::OnMiddleUp(wxMouseEvent& evt)
{
- wxAuiToolBarItem* hit_item;
- hit_item = FindToolByPosition(evt.GetX(), evt.GetY());
+ wxAuiToolBarItem* hitItem;
+ hitItem = FindToolByPosition(evt.GetX(), evt.GetY());
- if (m_action_item && hit_item == m_action_item)
+ if (m_actionItem && hitItem == m_actionItem)
{
- if (hit_item->kind == wxITEM_NORMAL)
+ if (hitItem->m_kind == wxITEM_NORMAL)
{
- wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, m_action_item->toolid);
+ wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, m_actionItem->m_toolId);
e.SetEventObject(this);
- e.SetToolId(m_action_item->toolid);
- e.SetClickPoint(m_action_pos);
+ e.SetToolId(m_actionItem->m_toolId);
+ e.SetClickPoint(m_actionPos);
GetEventHandler()->ProcessEvent(e);
DoIdleUpdate();
}
}
// reset member variables
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
}
void wxAuiToolBar::OnMotion(wxMouseEvent& evt)
// start a drag event
if (!m_dragging && button_pressed &&
- abs(evt.GetX() - m_action_pos.x) + abs(evt.GetY() - m_action_pos.y) > 5)
+ abs(evt.GetX() - m_actionPos.x) + abs(evt.GetY() - m_actionPos.y) > 5)
{
// TODO: sending this event only makes sense if there is an 'END_DRAG'
// event sent sometime in the future (see OnLeftUp())
wxAuiToolBarEvent e(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, GetId());
e.SetEventObject(this);
- e.SetToolId(m_action_item->toolid);
+ e.SetToolId(m_actionItem->m_toolId);
m_dragging = GetEventHandler()->ProcessEvent(e) && !e.GetSkipped();
DoIdleUpdate();
if(m_dragging)
return;
- wxAuiToolBarItem* hit_item = FindToolByPosition(evt.GetX(), evt.GetY());
+ wxAuiToolBarItem* hitItem = FindToolByPosition(evt.GetX(), evt.GetY());
if(button_pressed)
{
// if we have a button pressed we want it to be shown in 'depressed'
// state unless we move the mouse outside the button, then we want it
// to show as just 'highlighted'
- if (hit_item == m_action_item)
- SetPressedItem(m_action_item);
+ if (hitItem == m_actionItem)
+ SetPressedItem(m_actionItem);
else
{
SetPressedItem(NULL);
- SetHoverItem(m_action_item);
+ SetHoverItem(m_actionItem);
}
}
else
{
- if (hit_item && (hit_item->state & wxAUI_BUTTON_STATE_DISABLED))
+ if (hitItem && (hitItem->m_state & wxAUI_BUTTON_STATE_DISABLED))
SetHoverItem(NULL);
else
- SetHoverItem(hit_item);
+ SetHoverItem(hitItem);
// tooltips handling
- wxAuiToolBarItem* packing_hit_item;
- packing_hit_item = FindToolByPositionWithPacking(evt.GetX(), evt.GetY());
- if (packing_hit_item)
+ wxAuiToolBarItem* packingHitItem;
+ packingHitItem = FindToolByPositionWithPacking(evt.GetX(), evt.GetY());
+ if (packingHitItem)
{
- if (packing_hit_item != m_tip_item)
+ if (packingHitItem != m_tipItem)
{
- m_tip_item = packing_hit_item;
+ m_tipItem = packingHitItem;
- if ( !packing_hit_item->short_help.empty() )
- SetToolTip(packing_hit_item->short_help);
+ if ( !packingHitItem->m_shortHelp.empty() )
+ SetToolTip(packingHitItem->m_shortHelp);
else
UnsetToolTip();
}
else
{
UnsetToolTip();
- m_tip_item = NULL;
+ m_tipItem = NULL;
}
// figure out the dropdown button state (are we hovering or pressing it?)
SetHoverItem(NULL);
SetPressedItem(NULL);
- m_tip_item = NULL;
+ m_tipItem = NULL;
// we have to reset those here, because the mouse-up handlers which do
// it usually won't be called if we let go of a mouse button while we
// are outside of the window
- m_action_pos = wxPoint(-1,-1);
- m_action_item = NULL;
+ m_actionPos = wxPoint(-1,-1);
+ m_actionItem = NULL;
}
void wxAuiToolBar::OnLeaveWindow(wxMouseEvent& evt)
{
wxCursor cursor = wxNullCursor;
- if (m_gripper_sizer_item)
+ if (m_gripperSizerItem)
{
- wxRect gripper_rect = m_gripper_sizer_item->GetRect();
+ wxRect gripper_rect = m_gripperSizerItem->GetRect();
if (gripper_rect.Contains(evt.GetX(), evt.GetY()))
{
cursor = wxCursor(wxCURSOR_SIZING);
{
public:
- wxAuiCommandCapture() { m_last_id = 0; }
- int GetCommandId() const { return m_last_id; }
+ wxAuiCommandCapture() { m_lastId = 0; }
+ int GetCommandId() const { return m_lastId; }
bool ProcessEvent(wxEvent& evt)
{
if (evt.GetEventType() == wxEVT_COMMAND_MENU_SELECTED)
{
- m_last_id = evt.GetId();
+ m_lastId = evt.GetId();
return true;
}
}
private:
- int m_last_id;
+ int m_lastId;
};
wxAuiDefaultTabArt::wxAuiDefaultTabArt()
{
- m_normal_font = *wxNORMAL_FONT;
- m_selected_font = *wxNORMAL_FONT;
- m_selected_font.SetWeight(wxBOLD);
- m_measuring_font = m_selected_font;
+ m_normalFont = *wxNORMAL_FONT;
+ m_selectedFont = *wxNORMAL_FONT;
+ m_selectedFont.SetWeight(wxBOLD);
+ m_measuringFont = m_selectedFont;
- m_fixed_tab_width = 100;
- m_tab_ctrl_height = 0;
+ m_fixedTabWidth = 100;
+ m_tabCtrlHeight = 0;
#if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
- wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
+ wxColor baseColour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
#else
- wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
+ wxColor baseColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
#endif
- // the base_colour is too pale to use as our base colour,
+ // the baseColour is too pale to use as our base colour,
// so darken it a bit --
- if ((255-base_colour.Red()) +
- (255-base_colour.Green()) +
- (255-base_colour.Blue()) < 60)
+ if ((255-baseColour.Red()) +
+ (255-baseColour.Green()) +
+ (255-baseColour.Blue()) < 60)
{
- base_colour = base_colour.ChangeLightness(92);
+ baseColour = baseColour.ChangeLightness(92);
}
- m_active_colour = base_colour;
- m_base_colour = base_colour;
- wxColor border_colour = base_colour.ChangeLightness(75);
+ m_activeColour = baseColour;
+ m_baseColour = baseColour;
+ wxColor borderColour = baseColour.ChangeLightness(75);
- m_border_pen = wxPen(border_colour);
- m_base_colour_pen = wxPen(m_base_colour);
- m_base_colour_brush = wxBrush(m_base_colour);
+ m_borderPen = wxPen(borderColour);
+ m_baseColourPen = wxPen(m_baseColour);
+ m_baseColourBrush = wxBrush(m_baseColour);
- m_active_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, *wxBLACK);
- m_disabled_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, wxColour(128,128,128));
+ m_activeCloseBmp = wxAuiBitmapFromBits(close_bits, 16, 16, *wxBLACK);
+ m_disabledCloseBmp = wxAuiBitmapFromBits(close_bits, 16, 16, wxColour(128,128,128));
- m_active_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, *wxBLACK);
- m_disabled_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, wxColour(128,128,128));
+ m_activeLeftBmp = wxAuiBitmapFromBits(left_bits, 16, 16, *wxBLACK);
+ m_disabledLeftBmp = wxAuiBitmapFromBits(left_bits, 16, 16, wxColour(128,128,128));
- m_active_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, *wxBLACK);
- m_disabled_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, wxColour(128,128,128));
+ m_activeRightBmp = wxAuiBitmapFromBits(right_bits, 16, 16, *wxBLACK);
+ m_disabledRightBmp = wxAuiBitmapFromBits(right_bits, 16, 16, wxColour(128,128,128));
- m_active_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, *wxBLACK);
- m_disabled_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, wxColour(128,128,128));
+ m_activeWindowListBmp = wxAuiBitmapFromBits(list_bits, 16, 16, *wxBLACK);
+ m_disabledWindowListBmp = wxAuiBitmapFromBits(list_bits, 16, 16, wxColour(128,128,128));
m_flags = 0;
}
void wxAuiDefaultTabArt::SetSizingInfo(const wxSize& tab_ctrl_size,
size_t tab_count)
{
- m_fixed_tab_width = 100;
+ m_fixedTabWidth = 100;
int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4;
if (m_flags & wxAUI_NB_CLOSE_BUTTON)
- tot_width -= m_active_close_bmp.GetWidth();
+ tot_width -= m_activeCloseBmp.GetWidth();
if (m_flags & wxAUI_NB_WINDOWLIST_BUTTON)
- tot_width -= m_active_windowlist_bmp.GetWidth();
+ tot_width -= m_activeWindowListBmp.GetWidth();
if (tab_count > 0)
{
- m_fixed_tab_width = tot_width/(int)tab_count;
+ m_fixedTabWidth = tot_width/(int)tab_count;
}
- if (m_fixed_tab_width < 100)
- m_fixed_tab_width = 100;
+ if (m_fixedTabWidth < 100)
+ m_fixedTabWidth = 100;
- if (m_fixed_tab_width > tot_width/2)
- m_fixed_tab_width = tot_width/2;
+ if (m_fixedTabWidth > tot_width/2)
+ m_fixedTabWidth = tot_width/2;
- if (m_fixed_tab_width > 220)
- m_fixed_tab_width = 220;
+ if (m_fixedTabWidth > 220)
+ m_fixedTabWidth = 220;
- m_tab_ctrl_height = tab_ctrl_size.y;
+ m_tabCtrlHeight = tab_ctrl_size.y;
}
{
// draw background
- wxColor top_color = m_base_colour.ChangeLightness(90);
- wxColor bottom_color = m_base_colour.ChangeLightness(170);
+ wxColor top_color = m_baseColour.ChangeLightness(90);
+ wxColor bottom_color = m_baseColour.ChangeLightness(170);
wxRect r;
if (m_flags &wxAUI_NB_BOTTOM)
// draw base lines
- dc.SetPen(m_border_pen);
+ dc.SetPen(m_borderPen);
int y = rect.GetHeight();
int w = rect.GetWidth();
// TODO: else if (m_flags &wxAUI_NB_RIGHT) {}
else //for wxAUI_NB_TOP
{
- dc.SetBrush(m_base_colour_brush);
+ dc.SetBrush(m_baseColourBrush);
dc.DrawRectangle(-1, y-4, w+2, 4);
}
}
if (caption.empty())
caption = wxT("Xj");
- dc.SetFont(m_selected_font);
+ dc.SetFont(m_selectedFont);
dc.GetTextExtent(caption, &selected_textx, &selected_texty);
- dc.SetFont(m_normal_font);
+ dc.SetFont(m_normalFont);
dc.GetTextExtent(caption, &normal_textx, &normal_texty);
// figure out the size of the tab
close_button_state,
x_extent);
- wxCoord tab_height = m_tab_ctrl_height - 3;
+ wxCoord tab_height = m_tabCtrlHeight - 3;
wxCoord tab_width = tab_size.x;
wxCoord tab_x = in_rect.x;
wxCoord tab_y = in_rect.y + in_rect.height - tab_height;
if (page.active)
{
- dc.SetFont(m_selected_font);
+ dc.SetFont(m_selectedFont);
texty = selected_texty;
}
else
{
- dc.SetFont(m_normal_font);
+ dc.SetFont(m_normalFont);
texty = normal_texty;
}
// draw base background color
wxRect r(tab_x, tab_y, tab_width, tab_height);
- dc.SetPen(wxPen(m_active_colour));
- dc.SetBrush(wxBrush(m_active_colour));
+ dc.SetPen(wxPen(m_activeColour));
+ dc.SetBrush(wxBrush(m_activeColour));
dc.DrawRectangle(r.x+1, r.y+1, r.width-1, r.height-4);
// this white helps fill out the gradient at the top of the tab
dc.DrawRectangle(r.x+2, r.y+1, r.width-3, r.height-4);
// these two points help the rounded corners appear more antialiased
- dc.SetPen(wxPen(m_active_colour));
+ dc.SetPen(wxPen(m_activeColour));
dc.DrawPoint(r.x+2, r.y+1);
dc.DrawPoint(r.x+r.width-2, r.y+1);
// draw gradient background
wxColor top_color = *wxWHITE;
- wxColor bottom_color = m_active_colour;
+ wxColor bottom_color = m_activeColour;
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
}
else
r.height--;
// -- draw top gradient fill for glossy look
- wxColor top_color = m_base_colour;
+ wxColor top_color = m_baseColour;
wxColor bottom_color = top_color.ChangeLightness(160);
dc.GradientFillLinear(r, bottom_color, top_color, wxNORTH);
r.y--;
// -- draw bottom fill for glossy look
- top_color = m_base_colour;
- bottom_color = m_base_colour;
+ top_color = m_baseColour;
+ bottom_color = m_baseColour;
dc.GradientFillLinear(r, top_color, bottom_color, wxSOUTH);
}
// draw tab outline
- dc.SetPen(m_border_pen);
+ dc.SetPen(m_borderPen);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawPolygon(WXSIZEOF(border_points), border_points);
if (page.active)
{
if (m_flags &wxAUI_NB_BOTTOM)
- dc.SetPen(wxPen(m_base_colour.ChangeLightness(170)));
+ dc.SetPen(wxPen(m_baseColour.ChangeLightness(170)));
// TODO: else if (m_flags &wxAUI_NB_LEFT) {}
// TODO: else if (m_flags &wxAUI_NB_RIGHT) {}
else //for wxAUI_NB_TOP
- dc.SetPen(m_base_colour_pen);
+ dc.SetPen(m_baseColourPen);
dc.DrawLine(border_points[0].x+1,
border_points[0].y,
border_points[5].x,
int close_button_width = 0;
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
{
- close_button_width = m_active_close_bmp.GetWidth();
+ close_button_width = m_activeCloseBmp.GetWidth();
}
int bitmap_offset = 0;
// draw close button if necessary
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
{
- wxBitmap bmp = m_disabled_close_bmp;
+ wxBitmap bmp = m_disabledCloseBmp;
if (close_button_state == wxAUI_BUTTON_STATE_HOVER ||
close_button_state == wxAUI_BUTTON_STATE_PRESSED)
{
- bmp = m_active_close_bmp;
+ bmp = m_activeCloseBmp;
}
int offsetY = tab_y-1;
{
wxCoord measured_textx, measured_texty, tmp;
- dc.SetFont(m_measuring_font);
+ dc.SetFont(m_measuringFont);
dc.GetTextExtent(caption, &measured_textx, &measured_texty);
dc.GetTextExtent(wxT("ABCDEFXj"), &tmp, &measured_texty);
// if the close button is showing, add space for it
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
- tab_width += m_active_close_bmp.GetWidth() + 3;
+ tab_width += m_activeCloseBmp.GetWidth() + 3;
// if there's a bitmap, add space for it
if (bitmap.IsOk())
if (m_flags & wxAUI_NB_TAB_FIXED_WIDTH)
{
- tab_width = m_fixed_tab_width;
+ tab_width = m_fixedTabWidth;
}
*x_extent = tab_width;
{
case wxAUI_BUTTON_CLOSE:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_close_bmp;
+ bmp = m_disabledCloseBmp;
else
- bmp = m_active_close_bmp;
+ bmp = m_activeCloseBmp;
break;
case wxAUI_BUTTON_LEFT:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_left_bmp;
+ bmp = m_disabledLeftBmp;
else
- bmp = m_active_left_bmp;
+ bmp = m_activeLeftBmp;
break;
case wxAUI_BUTTON_RIGHT:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_right_bmp;
+ bmp = m_disabledRightBmp;
else
- bmp = m_active_right_bmp;
+ bmp = m_activeRightBmp;
break;
case wxAUI_BUTTON_WINDOWLIST:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_windowlist_bmp;
+ bmp = m_disabledWindowListBmp;
else
- bmp = m_active_windowlist_bmp;
+ bmp = m_activeWindowListBmp;
break;
}
int wxAuiDefaultTabArt::GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
- const wxSize& required_bmp_size)
+ const wxSize& requiredBmp_size)
{
wxClientDC dc(wnd);
- dc.SetFont(m_measuring_font);
+ dc.SetFont(m_measuringFont);
// sometimes a standard bitmap size needs to be enforced, especially
// if some tabs have bitmaps and others don't. This is important because
// it prevents the tab control from resizing when tabs are added.
- wxBitmap measure_bmp;
- if (required_bmp_size.IsFullySpecified())
+ wxBitmap measureBmp;
+ if (requiredBmp_size.IsFullySpecified())
{
- measure_bmp.Create(required_bmp_size.x,
- required_bmp_size.y);
+ measureBmp.Create(requiredBmp_size.x,
+ requiredBmp_size.y);
}
wxAuiNotebookPage& page = pages.Item(i);
wxBitmap bmp;
- if (measure_bmp.IsOk())
- bmp = measure_bmp;
+ if (measureBmp.IsOk())
+ bmp = measureBmp;
else
bmp = page.bitmap;
void wxAuiDefaultTabArt::SetNormalFont(const wxFont& font)
{
- m_normal_font = font;
+ m_normalFont = font;
}
void wxAuiDefaultTabArt::SetSelectedFont(const wxFont& font)
{
- m_selected_font = font;
+ m_selectedFont = font;
}
void wxAuiDefaultTabArt::SetMeasuringFont(const wxFont& font)
{
- m_measuring_font = font;
+ m_measuringFont = font;
}
void wxAuiDefaultTabArt::SetColour(const wxColour& colour)
{
- m_base_colour = colour;
- m_border_pen = wxPen(m_base_colour.ChangeLightness(75));
- m_base_colour_pen = wxPen(m_base_colour);
- m_base_colour_brush = wxBrush(m_base_colour);
+ m_baseColour = colour;
+ m_borderPen = wxPen(m_baseColour.ChangeLightness(75));
+ m_baseColourPen = wxPen(m_baseColour);
+ m_baseColourBrush = wxBrush(m_baseColour);
}
void wxAuiDefaultTabArt::SetActiveColour(const wxColour& colour)
{
- m_active_colour = colour;
+ m_activeColour = colour;
}
// -- wxAuiSimpleTabArt class implementation --
wxAuiSimpleTabArt::wxAuiSimpleTabArt()
{
- m_normal_font = *wxNORMAL_FONT;
- m_selected_font = *wxNORMAL_FONT;
- m_selected_font.SetWeight(wxBOLD);
- m_measuring_font = m_selected_font;
+ m_normalFont = *wxNORMAL_FONT;
+ m_selectedFont = *wxNORMAL_FONT;
+ m_selectedFont.SetWeight(wxBOLD);
+ m_measuringFont = m_selectedFont;
m_flags = 0;
- m_fixed_tab_width = 100;
+ m_fixedTabWidth = 100;
- wxColour base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
+ wxColour baseColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
- wxColour background_colour = base_colour;
- wxColour normaltab_colour = base_colour;
- wxColour selectedtab_colour = *wxWHITE;
+ wxColour backgroundColour = baseColour;
+ wxColour normaltabColour = baseColour;
+ wxColour selectedtabColour = *wxWHITE;
- m_bkbrush = wxBrush(background_colour);
- m_normal_bkbrush = wxBrush(normaltab_colour);
- m_normal_bkpen = wxPen(normaltab_colour);
- m_selected_bkbrush = wxBrush(selectedtab_colour);
- m_selected_bkpen = wxPen(selectedtab_colour);
+ m_bkBrush = wxBrush(backgroundColour);
+ m_normalBkBrush = wxBrush(normaltabColour);
+ m_normalBkPen = wxPen(normaltabColour);
+ m_selectedBkBrush = wxBrush(selectedtabColour);
+ m_selectedBkPen = wxPen(selectedtabColour);
- m_active_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, *wxBLACK);
- m_disabled_close_bmp = wxAuiBitmapFromBits(close_bits, 16, 16, wxColour(128,128,128));
+ m_activeCloseBmp = wxAuiBitmapFromBits(close_bits, 16, 16, *wxBLACK);
+ m_disabledCloseBmp = wxAuiBitmapFromBits(close_bits, 16, 16, wxColour(128,128,128));
- m_active_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, *wxBLACK);
- m_disabled_left_bmp = wxAuiBitmapFromBits(left_bits, 16, 16, wxColour(128,128,128));
+ m_activeLeftBmp = wxAuiBitmapFromBits(left_bits, 16, 16, *wxBLACK);
+ m_disabledLeftBmp = wxAuiBitmapFromBits(left_bits, 16, 16, wxColour(128,128,128));
- m_active_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, *wxBLACK);
- m_disabled_right_bmp = wxAuiBitmapFromBits(right_bits, 16, 16, wxColour(128,128,128));
+ m_activeRightBmp = wxAuiBitmapFromBits(right_bits, 16, 16, *wxBLACK);
+ m_disabledRightBmp = wxAuiBitmapFromBits(right_bits, 16, 16, wxColour(128,128,128));
- m_active_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, *wxBLACK);
- m_disabled_windowlist_bmp = wxAuiBitmapFromBits(list_bits, 16, 16, wxColour(128,128,128));
+ m_activeWindowListBmp = wxAuiBitmapFromBits(list_bits, 16, 16, *wxBLACK);
+ m_disabledWindowListBmp = wxAuiBitmapFromBits(list_bits, 16, 16, wxColour(128,128,128));
}
void wxAuiSimpleTabArt::SetSizingInfo(const wxSize& tab_ctrl_size,
size_t tab_count)
{
- m_fixed_tab_width = 100;
+ m_fixedTabWidth = 100;
int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - 4;
if (m_flags & wxAUI_NB_CLOSE_BUTTON)
- tot_width -= m_active_close_bmp.GetWidth();
+ tot_width -= m_activeCloseBmp.GetWidth();
if (m_flags & wxAUI_NB_WINDOWLIST_BUTTON)
- tot_width -= m_active_windowlist_bmp.GetWidth();
+ tot_width -= m_activeWindowListBmp.GetWidth();
if (tab_count > 0)
{
- m_fixed_tab_width = tot_width/(int)tab_count;
+ m_fixedTabWidth = tot_width/(int)tab_count;
}
- if (m_fixed_tab_width < 100)
- m_fixed_tab_width = 100;
+ if (m_fixedTabWidth < 100)
+ m_fixedTabWidth = 100;
- if (m_fixed_tab_width > tot_width/2)
- m_fixed_tab_width = tot_width/2;
+ if (m_fixedTabWidth > tot_width/2)
+ m_fixedTabWidth = tot_width/2;
- if (m_fixed_tab_width > 220)
- m_fixed_tab_width = 220;
+ if (m_fixedTabWidth > 220)
+ m_fixedTabWidth = 220;
}
void wxAuiSimpleTabArt::SetColour(const wxColour& colour)
{
- m_bkbrush = wxBrush(colour);
- m_normal_bkbrush = wxBrush(colour);
- m_normal_bkpen = wxPen(colour);
+ m_bkBrush = wxBrush(colour);
+ m_normalBkBrush = wxBrush(colour);
+ m_normalBkPen = wxPen(colour);
}
void wxAuiSimpleTabArt::SetActiveColour(const wxColour& colour)
{
- m_selected_bkbrush = wxBrush(colour);
- m_selected_bkpen = wxPen(colour);
+ m_selectedBkBrush = wxBrush(colour);
+ m_selectedBkPen = wxPen(colour);
}
void wxAuiSimpleTabArt::DrawBackground(wxDC& dc,
const wxRect& rect)
{
// draw background
- dc.SetBrush(m_bkbrush);
+ dc.SetBrush(m_bkBrush);
dc.SetPen(*wxTRANSPARENT_PEN);
dc.DrawRectangle(-1, -1, rect.GetWidth()+2, rect.GetHeight()+2);
if (caption.empty())
caption = wxT("Xj");
- dc.SetFont(m_selected_font);
+ dc.SetFont(m_selectedFont);
dc.GetTextExtent(caption, &selected_textx, &selected_texty);
- dc.SetFont(m_normal_font);
+ dc.SetFont(m_normalFont);
dc.GetTextExtent(caption, &normal_textx, &normal_texty);
// figure out the size of the tab
if (page.active)
{
- dc.SetPen(m_selected_bkpen);
- dc.SetBrush(m_selected_bkbrush);
- dc.SetFont(m_selected_font);
+ dc.SetPen(m_selectedBkPen);
+ dc.SetBrush(m_selectedBkBrush);
+ dc.SetFont(m_selectedFont);
textx = selected_textx;
texty = selected_texty;
}
else
{
- dc.SetPen(m_normal_bkpen);
- dc.SetBrush(m_normal_bkbrush);
- dc.SetFont(m_normal_font);
+ dc.SetPen(m_normalBkPen);
+ dc.SetBrush(m_normalBkBrush);
+ dc.SetFont(m_normalFont);
textx = normal_textx;
texty = normal_texty;
}
int close_button_width = 0;
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
{
- close_button_width = m_active_close_bmp.GetWidth();
+ close_button_width = m_activeCloseBmp.GetWidth();
text_offset = tab_x + (tab_height/2) + ((tab_width-close_button_width)/2) - (textx/2);
}
else
{
wxBitmap bmp;
if (page.active)
- bmp = m_active_close_bmp;
+ bmp = m_activeCloseBmp;
else
- bmp = m_disabled_close_bmp;
+ bmp = m_disabledCloseBmp;
wxRect rect(tab_x + tab_width - close_button_width - 1,
tab_y + (tab_height/2) - (bmp.GetHeight()/2) + 1,
{
wxCoord measured_textx, measured_texty;
- dc.SetFont(m_measuring_font);
+ dc.SetFont(m_measuringFont);
dc.GetTextExtent(caption, &measured_textx, &measured_texty);
wxCoord tab_height = measured_texty + 4;
wxCoord tab_width = measured_textx + tab_height + 5;
if (close_button_state != wxAUI_BUTTON_STATE_HIDDEN)
- tab_width += m_active_close_bmp.GetWidth();
+ tab_width += m_activeCloseBmp.GetWidth();
if (m_flags & wxAUI_NB_TAB_FIXED_WIDTH)
{
- tab_width = m_fixed_tab_width;
+ tab_width = m_fixedTabWidth;
}
*x_extent = tab_width - (tab_height/2) - 1;
{
case wxAUI_BUTTON_CLOSE:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_close_bmp;
+ bmp = m_disabledCloseBmp;
else
- bmp = m_active_close_bmp;
+ bmp = m_activeCloseBmp;
break;
case wxAUI_BUTTON_LEFT:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_left_bmp;
+ bmp = m_disabledLeftBmp;
else
- bmp = m_active_left_bmp;
+ bmp = m_activeLeftBmp;
break;
case wxAUI_BUTTON_RIGHT:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_right_bmp;
+ bmp = m_disabledRightBmp;
else
- bmp = m_active_right_bmp;
+ bmp = m_activeRightBmp;
break;
case wxAUI_BUTTON_WINDOWLIST:
if (button_state & wxAUI_BUTTON_STATE_DISABLED)
- bmp = m_disabled_windowlist_bmp;
+ bmp = m_disabledWindowListBmp;
else
- bmp = m_active_windowlist_bmp;
+ bmp = m_activeWindowListBmp;
break;
}
int wxAuiSimpleTabArt::GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& WXUNUSED(pages),
- const wxSize& WXUNUSED(required_bmp_size))
+ const wxSize& WXUNUSED(requiredBmp_size))
{
wxClientDC dc(wnd);
- dc.SetFont(m_measuring_font);
+ dc.SetFont(m_measuringFont);
int x_ext = 0;
wxSize s = GetTabSize(dc,
wnd,
void wxAuiSimpleTabArt::SetNormalFont(const wxFont& font)
{
- m_normal_font = font;
+ m_normalFont = font;
}
void wxAuiSimpleTabArt::SetSelectedFont(const wxFont& font)
{
- m_selected_font = font;
+ m_selectedFont = font;
}
void wxAuiSimpleTabArt::SetMeasuringFont(const wxFont& font)
{
- m_measuring_font = font;
+ m_measuringFont = font;
}
wxAuiTabContainer::wxAuiTabContainer()
{
- m_tab_offset = 0;
+ m_tabOffset = 0;
m_flags = 0;
m_art = new wxAuiDefaultTabArt;
void wxAuiTabContainer::AddButton(int id,
int location,
- const wxBitmap& normal_bitmap,
- const wxBitmap& disabled_bitmap)
+ const wxBitmap& normalBitmap,
+ const wxBitmap& disabledBitmap)
{
wxAuiTabContainerButton button;
button.id = id;
- button.bitmap = normal_bitmap;
- button.dis_bitmap = disabled_bitmap;
+ button.bitmap = normalBitmap;
+ button.disBitmap = disabledBitmap;
button.location = location;
- button.cur_state = wxAUI_BUTTON_STATE_NORMAL;
+ button.curState = wxAUI_BUTTON_STATE_NORMAL;
m_buttons.Add(button);
}
size_t wxAuiTabContainer::GetTabOffset() const
{
- return m_tab_offset;
+ return m_tabOffset;
}
void wxAuiTabContainer::SetTabOffset(size_t offset)
{
- m_tab_offset = offset;
+ m_tabOffset = offset;
}
else
total_width += size.x;
- if (i >= m_tab_offset)
+ if (i >= m_tabOffset)
{
if (i+1 < page_count)
visible_width += x_extent;
}
}
- if (total_width > m_rect.GetWidth() || m_tab_offset != 0)
+ if (total_width > m_rect.GetWidth() || m_tabOffset != 0)
{
// show left/right buttons
for (i = 0; i < button_count; ++i)
if (button.id == wxAUI_BUTTON_LEFT ||
button.id == wxAUI_BUTTON_RIGHT)
{
- button.cur_state &= ~wxAUI_BUTTON_STATE_HIDDEN;
+ button.curState &= ~wxAUI_BUTTON_STATE_HIDDEN;
}
}
}
if (button.id == wxAUI_BUTTON_LEFT ||
button.id == wxAUI_BUTTON_RIGHT)
{
- button.cur_state |= wxAUI_BUTTON_STATE_HIDDEN;
+ button.curState |= wxAUI_BUTTON_STATE_HIDDEN;
}
}
}
wxAuiTabContainerButton& button = m_buttons.Item(i);
if (button.id == wxAUI_BUTTON_LEFT)
{
- if (m_tab_offset == 0)
- button.cur_state |= wxAUI_BUTTON_STATE_DISABLED;
+ if (m_tabOffset == 0)
+ button.curState |= wxAUI_BUTTON_STATE_DISABLED;
else
- button.cur_state &= ~wxAUI_BUTTON_STATE_DISABLED;
+ button.curState &= ~wxAUI_BUTTON_STATE_DISABLED;
}
if (button.id == wxAUI_BUTTON_RIGHT)
{
if (visible_width < m_rect.GetWidth() - ((int)button_count*16))
- button.cur_state |= wxAUI_BUTTON_STATE_DISABLED;
+ button.curState |= wxAUI_BUTTON_STATE_DISABLED;
else
- button.cur_state &= ~wxAUI_BUTTON_STATE_DISABLED;
+ button.curState &= ~wxAUI_BUTTON_STATE_DISABLED;
}
}
if (button.location != wxRIGHT)
continue;
- if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN)
+ if (button.curState & wxAUI_BUTTON_STATE_HIDDEN)
continue;
wxRect button_rect = m_rect;
wnd,
button_rect,
button.id,
- button.cur_state,
+ button.curState,
wxRIGHT,
&button.rect);
if (button.location != wxLEFT)
continue;
- if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN)
+ if (button.curState & wxAUI_BUTTON_STATE_HIDDEN)
continue;
wxRect button_rect(offset, 1, 1000, m_rect.height);
wnd,
button_rect,
button.id,
- button.cur_state,
+ button.curState,
wxLEFT,
&button.rect);
// prepare the tab-close-button array
// make sure tab button entries which aren't used are marked as hidden
- for (i = page_count; i < m_tab_close_buttons.GetCount(); ++i)
- m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN;
+ for (i = page_count; i < m_tabCloseButtons.GetCount(); ++i)
+ m_tabCloseButtons.Item(i).curState = wxAUI_BUTTON_STATE_HIDDEN;
// make sure there are enough tab button entries to accommodate all tabs
- while (m_tab_close_buttons.GetCount() < page_count)
+ while (m_tabCloseButtons.GetCount() < page_count)
{
wxAuiTabContainerButton tempbtn;
tempbtn.id = wxAUI_BUTTON_CLOSE;
tempbtn.location = wxCENTER;
- tempbtn.cur_state = wxAUI_BUTTON_STATE_HIDDEN;
- m_tab_close_buttons.Add(tempbtn);
+ tempbtn.curState = wxAUI_BUTTON_STATE_HIDDEN;
+ m_tabCloseButtons.Add(tempbtn);
}
// buttons before the tab offset must be set to hidden
- for (i = 0; i < m_tab_offset; ++i)
+ for (i = 0; i < m_tabOffset; ++i)
{
- m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN;
+ m_tabCloseButtons.Item(i).curState = wxAUI_BUTTON_STATE_HIDDEN;
}
rect.y = 0;
rect.height = m_rect.height;
- for (i = m_tab_offset; i < page_count; ++i)
+ for (i = m_tabOffset; i < page_count; ++i)
{
wxAuiNotebookPage& page = m_pages.Item(i);
- wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(i);
+ wxAuiTabContainerButton& tab_button = m_tabCloseButtons.Item(i);
// determine if a close button is on this tab
if ((m_flags & wxAUI_NB_CLOSE_ON_ALL_TABS) != 0 ||
((m_flags & wxAUI_NB_CLOSE_ON_ACTIVE_TAB) != 0 && page.active))
{
- if (tab_button.cur_state == wxAUI_BUTTON_STATE_HIDDEN)
+ if (tab_button.curState == wxAUI_BUTTON_STATE_HIDDEN)
{
tab_button.id = wxAUI_BUTTON_CLOSE;
- tab_button.cur_state = wxAUI_BUTTON_STATE_NORMAL;
+ tab_button.curState = wxAUI_BUTTON_STATE_NORMAL;
tab_button.location = wxCENTER;
}
}
else
{
- tab_button.cur_state = wxAUI_BUTTON_STATE_HIDDEN;
+ tab_button.curState = wxAUI_BUTTON_STATE_HIDDEN;
}
rect.x = offset;
wnd,
page,
rect,
- tab_button.cur_state,
+ tab_button.curState,
&page.rect,
&tab_button.rect,
&x_extent);
// make sure to deactivate buttons which are off the screen to the right
- for (++i; i < m_tab_close_buttons.GetCount(); ++i)
+ for (++i; i < m_tabCloseButtons.GetCount(); ++i)
{
- m_tab_close_buttons.Item(i).cur_state = wxAUI_BUTTON_STATE_HIDDEN;
+ m_tabCloseButtons.Item(i).curState = wxAUI_BUTTON_STATE_HIDDEN;
}
// draw the active tab again so it stands in the foreground
- if (active >= m_tab_offset && active < m_pages.GetCount())
+ if (active >= m_tabOffset && active < m_pages.GetCount())
{
wxAuiNotebookPage& page = m_pages.Item(active);
- wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(active);
+ wxAuiTabContainerButton& tab_button = m_tabCloseButtons.Item(active);
rect.x = active_offset;
m_art->DrawTab(dc,
wnd,
page,
active_rect,
- tab_button.cur_state,
+ tab_button.curState,
&page.rect,
&tab_button.rect,
&x_extent);
size_t button_count = m_buttons.GetCount();
// Hasn't been rendered yet; assume it's visible
- if (m_tab_close_buttons.GetCount() < page_count)
+ if (m_tabCloseButtons.GetCount() < page_count)
return true;
// First check if both buttons are disabled - if so, there's no need to
if (button.id == wxAUI_BUTTON_LEFT ||
button.id == wxAUI_BUTTON_RIGHT)
{
- if ((button.cur_state & wxAUI_BUTTON_STATE_HIDDEN) == 0)
+ if ((button.curState & wxAUI_BUTTON_STATE_HIDDEN) == 0)
arrowButtonVisibleCount ++;
}
}
if (button.location != wxRIGHT)
continue;
- if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN)
+ if (button.curState & wxAUI_BUTTON_STATE_HIDDEN)
continue;
offset -= button.rect.GetWidth();
if (button.location != wxLEFT)
continue;
- if (button.cur_state & wxAUI_BUTTON_STATE_HIDDEN)
+ if (button.curState & wxAUI_BUTTON_STATE_HIDDEN)
continue;
offset += button.rect.GetWidth();
for (i = tabOffset; i < page_count; ++i)
{
wxAuiNotebookPage& page = m_pages.Item(i);
- wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(i);
+ wxAuiTabContainerButton& tab_button = m_tabCloseButtons.Item(i);
rect.x = offset;
rect.width = m_rect.width - right_buttons_width - offset - 2;
page.caption,
page.bitmap,
page.active,
- tab_button.cur_state,
+ tab_button.curState,
&x_extent);
offset += x_extent;
return false;
wxAuiTabContainerButton* btn = NULL;
- if (ButtonHitTest(x, y, &btn) && !(btn->cur_state & wxAUI_BUTTON_STATE_DISABLED))
+ if (ButtonHitTest(x, y, &btn) && !(btn->curState & wxAUI_BUTTON_STATE_DISABLED))
{
if (m_buttons.Index(*btn) != wxNOT_FOUND)
return false;
size_t i, page_count = m_pages.GetCount();
- for (i = m_tab_offset; i < page_count; ++i)
+ for (i = m_tabOffset; i < page_count; ++i)
{
wxAuiNotebookPage& page = m_pages.Item(i);
if (page.rect.Contains(x,y))
{
wxAuiTabContainerButton& button = m_buttons.Item(i);
if (button.rect.Contains(x,y) &&
- !(button.cur_state & wxAUI_BUTTON_STATE_HIDDEN ))
+ !(button.curState & wxAUI_BUTTON_STATE_HIDDEN ))
{
if (hit)
*hit = &button;
}
}
- button_count = m_tab_close_buttons.GetCount();
+ button_count = m_tabCloseButtons.GetCount();
for (i = 0; i < button_count; ++i)
{
- wxAuiTabContainerButton& button = m_tab_close_buttons.Item(i);
+ wxAuiTabContainerButton& button = m_tabCloseButtons.Item(i);
if (button.rect.Contains(x,y) &&
- !(button.cur_state & (wxAUI_BUTTON_STATE_HIDDEN |
+ !(button.curState & (wxAUI_BUTTON_STATE_HIDDEN |
wxAUI_BUTTON_STATE_DISABLED)))
{
if (hit)
long style) : wxControl(parent, id, pos, size, style)
{
SetName(wxT("wxAuiTabCtrl"));
- m_click_pt = wxDefaultPosition;
- m_is_dragging = false;
- m_hover_button = NULL;
- m_pressed_button = NULL;
+ m_clickPt = wxDefaultPosition;
+ m_isDragging = false;
+ m_hoverButton = NULL;
+ m_pressedButton = NULL;
}
wxAuiTabCtrl::~wxAuiTabCtrl()
void wxAuiTabCtrl::OnLeftDown(wxMouseEvent& evt)
{
CaptureMouse();
- m_click_pt = wxDefaultPosition;
- m_is_dragging = false;
- m_click_tab = NULL;
- m_pressed_button = NULL;
+ m_clickPt = wxDefaultPosition;
+ m_isDragging = false;
+ m_clickTab = NULL;
+ m_pressedButton = NULL;
wxWindow* wnd;
GetEventHandler()->ProcessEvent(e);
}
- m_click_pt.x = evt.m_x;
- m_click_pt.y = evt.m_y;
- m_click_tab = wnd;
+ m_clickPt.x = evt.m_x;
+ m_clickPt.y = evt.m_y;
+ m_clickTab = wnd;
}
- if (m_hover_button)
+ if (m_hoverButton)
{
- m_pressed_button = m_hover_button;
- m_pressed_button->cur_state = wxAUI_BUTTON_STATE_PRESSED;
+ m_pressedButton = m_hoverButton;
+ m_pressedButton->curState = wxAUI_BUTTON_STATE_PRESSED;
Refresh();
Update();
}
void wxAuiTabCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event))
{
- if (m_is_dragging)
+ if (m_isDragging)
{
- m_is_dragging = false;
+ m_isDragging = false;
wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_CANCEL_DRAG, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_click_tab));
+ evt.SetSelection(GetIdxFromWindow(m_clickTab));
evt.SetOldSelection(evt.GetSelection());
evt.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
if (GetCapture() == this)
ReleaseMouse();
- if (m_is_dragging)
+ if (m_isDragging)
{
- m_is_dragging = false;
+ m_isDragging = false;
wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_click_tab));
+ evt.SetSelection(GetIdxFromWindow(m_clickTab));
evt.SetOldSelection(evt.GetSelection());
evt.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
return;
}
- if (m_pressed_button)
+ if (m_pressedButton)
{
// make sure we're still clicking the button
wxAuiTabContainerButton* button = NULL;
if (!ButtonHitTest(evt.m_x, evt.m_y, &button) ||
- button->cur_state & wxAUI_BUTTON_STATE_DISABLED)
+ button->curState & wxAUI_BUTTON_STATE_DISABLED)
return;
- if (button != m_pressed_button)
+ if (button != m_pressedButton)
{
- m_pressed_button = NULL;
+ m_pressedButton = NULL;
return;
}
Refresh();
Update();
- if (!(m_pressed_button->cur_state & wxAUI_BUTTON_STATE_DISABLED))
+ if (!(m_pressedButton->curState & wxAUI_BUTTON_STATE_DISABLED))
{
wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_click_tab));
- evt.SetInt(m_pressed_button->id);
+ evt.SetSelection(GetIdxFromWindow(m_clickTab));
+ evt.SetInt(m_pressedButton->id);
evt.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
}
- m_pressed_button = NULL;
+ m_pressedButton = NULL;
}
- m_click_pt = wxDefaultPosition;
- m_is_dragging = false;
- m_click_tab = NULL;
+ m_clickPt = wxDefaultPosition;
+ m_isDragging = false;
+ m_clickTab = NULL;
}
void wxAuiTabCtrl::OnMiddleUp(wxMouseEvent& evt)
// check if the mouse is hovering above a button
wxAuiTabContainerButton* button;
- if (ButtonHitTest(pos.x, pos.y, &button) && !(button->cur_state & wxAUI_BUTTON_STATE_DISABLED))
+ if (ButtonHitTest(pos.x, pos.y, &button) && !(button->curState & wxAUI_BUTTON_STATE_DISABLED))
{
- if (m_hover_button && button != m_hover_button)
+ if (m_hoverButton && button != m_hoverButton)
{
- m_hover_button->cur_state = wxAUI_BUTTON_STATE_NORMAL;
- m_hover_button = NULL;
+ m_hoverButton->curState = wxAUI_BUTTON_STATE_NORMAL;
+ m_hoverButton = NULL;
Refresh();
Update();
}
- if (button->cur_state != wxAUI_BUTTON_STATE_HOVER)
+ if (button->curState != wxAUI_BUTTON_STATE_HOVER)
{
- button->cur_state = wxAUI_BUTTON_STATE_HOVER;
+ button->curState = wxAUI_BUTTON_STATE_HOVER;
Refresh();
Update();
- m_hover_button = button;
+ m_hoverButton = button;
return;
}
}
else
{
- if (m_hover_button)
+ if (m_hoverButton)
{
- m_hover_button->cur_state = wxAUI_BUTTON_STATE_NORMAL;
- m_hover_button = NULL;
+ m_hoverButton->curState = wxAUI_BUTTON_STATE_NORMAL;
+ m_hoverButton = NULL;
Refresh();
Update();
}
}
- if (!evt.LeftIsDown() || m_click_pt == wxDefaultPosition)
+ if (!evt.LeftIsDown() || m_clickPt == wxDefaultPosition)
return;
- if (m_is_dragging)
+ if (m_isDragging)
{
wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_click_tab));
+ evt.SetSelection(GetIdxFromWindow(m_clickTab));
evt.SetOldSelection(evt.GetSelection());
evt.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
int drag_x_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_X);
int drag_y_threshold = wxSystemSettings::GetMetric(wxSYS_DRAG_Y);
- if (abs(pos.x - m_click_pt.x) > drag_x_threshold ||
- abs(pos.y - m_click_pt.y) > drag_y_threshold)
+ if (abs(pos.x - m_clickPt.x) > drag_x_threshold ||
+ abs(pos.y - m_clickPt.y) > drag_y_threshold)
{
wxAuiNotebookEvent evt(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, m_windowId);
- evt.SetSelection(GetIdxFromWindow(m_click_tab));
+ evt.SetSelection(GetIdxFromWindow(m_clickTab));
evt.SetOldSelection(evt.GetSelection());
evt.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
- m_is_dragging = true;
+ m_isDragging = true;
}
}
void wxAuiTabCtrl::OnLeaveWindow(wxMouseEvent& WXUNUSED(event))
{
- if (m_hover_button)
+ if (m_hoverButton)
{
- m_hover_button->cur_state = wxAUI_BUTTON_STATE_NORMAL;
- m_hover_button = NULL;
+ m_hoverButton->curState = wxAUI_BUTTON_STATE_NORMAL;
+ m_hoverButton = NULL;
Refresh();
Update();
}
{
m_tabs = NULL;
m_rect = wxRect(0,0,200,200);
- m_tab_ctrl_height = 20;
+ m_tabCtrlHeight = 20;
}
~wxTabFrame()
void SetTabCtrlHeight(int h)
{
- m_tab_ctrl_height = h;
+ m_tabCtrlHeight = h;
}
protected:
if (m_tabs->IsFrozen() || m_tabs->GetParent()->IsFrozen())
return;
- m_tab_rect = wxRect(m_rect.x, m_rect.y, m_rect.width, m_tab_ctrl_height);
+ m_tab_rect = wxRect(m_rect.x, m_rect.y, m_rect.width, m_tabCtrlHeight);
if (m_tabs->GetFlags() & wxAUI_NB_BOTTOM)
{
- m_tab_rect = wxRect (m_rect.x, m_rect.y + m_rect.height - m_tab_ctrl_height, m_rect.width, m_tab_ctrl_height);
- m_tabs->SetSize (m_rect.x, m_rect.y + m_rect.height - m_tab_ctrl_height, m_rect.width, m_tab_ctrl_height);
- m_tabs->SetRect (wxRect(0, 0, m_rect.width, m_tab_ctrl_height));
+ m_tab_rect = wxRect (m_rect.x, m_rect.y + m_rect.height - m_tabCtrlHeight, m_rect.width, m_tabCtrlHeight);
+ m_tabs->SetSize (m_rect.x, m_rect.y + m_rect.height - m_tabCtrlHeight, m_rect.width, m_tabCtrlHeight);
+ m_tabs->SetRect (wxRect(0, 0, m_rect.width, m_tabCtrlHeight));
}
else //TODO: if (GetFlags() & wxAUI_NB_TOP)
{
- m_tab_rect = wxRect (m_rect.x, m_rect.y, m_rect.width, m_tab_ctrl_height);
- m_tabs->SetSize (m_rect.x, m_rect.y, m_rect.width, m_tab_ctrl_height);
- m_tabs->SetRect (wxRect(0, 0, m_rect.width, m_tab_ctrl_height));
+ m_tab_rect = wxRect (m_rect.x, m_rect.y, m_rect.width, m_tabCtrlHeight);
+ m_tabs->SetSize (m_rect.x, m_rect.y, m_rect.width, m_tabCtrlHeight);
+ m_tabs->SetRect (wxRect(0, 0, m_rect.width, m_tabCtrlHeight));
}
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
// TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
for (i = 0; i < page_count; ++i)
{
- int height = m_rect.height - m_tab_ctrl_height;
+ int height = m_rect.height - m_tabCtrlHeight;
if ( height < 0 )
{
// avoid passing negative height to wxWindow::SetSize(), this
}
else //TODO: if (GetFlags() & wxAUI_NB_TOP)
{
- page.window->SetSize(m_rect.x, m_rect.y + m_tab_ctrl_height,
+ page.window->SetSize(m_rect.x, m_rect.y + m_tabCtrlHeight,
m_rect.width, height);
}
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
wxRect m_rect;
wxRect m_tab_rect;
wxAuiTabCtrl* m_tabs;
- int m_tab_ctrl_height;
+ int m_tabCtrlHeight;
};
void wxAuiNotebook::Init()
{
- m_curpage = -1;
- m_tab_id_counter = wxAuiBaseTabCtrlId;
- m_dummy_wnd = NULL;
- m_tab_ctrl_height = 20;
- m_requested_bmp_size = wxDefaultSize;
- m_requested_tabctrl_height = -1;
+ m_curPage = -1;
+ m_tabIdCounter = wxAuiBaseTabCtrlId;
+ m_dummyWnd = NULL;
+ m_tabCtrlHeight = 20;
+ m_requestedBmpSize = wxDefaultSize;
+ m_requestedTabCtrlHeight = -1;
}
bool wxAuiNotebook::Create(wxWindow* parent,
void wxAuiNotebook::InitNotebook(long style)
{
SetName(wxT("wxAuiNotebook"));
- m_curpage = -1;
- m_tab_id_counter = wxAuiBaseTabCtrlId;
- m_dummy_wnd = NULL;
+ m_curPage = -1;
+ m_tabIdCounter = wxAuiBaseTabCtrlId;
+ m_dummyWnd = NULL;
m_flags = (unsigned int)style;
- m_tab_ctrl_height = 20;
+ m_tabCtrlHeight = 20;
- m_normal_font = *wxNORMAL_FONT;
- m_selected_font = *wxNORMAL_FONT;
- m_selected_font.SetWeight(wxBOLD);
+ m_normalFont = *wxNORMAL_FONT;
+ m_selectedFont = *wxNORMAL_FONT;
+ m_selectedFont.SetWeight(wxBOLD);
SetArtProvider(new wxAuiDefaultTabArt);
- m_dummy_wnd = new wxWindow(this, wxID_ANY, wxPoint(0,0), wxSize(0,0));
- m_dummy_wnd->SetSize(200, 200);
- m_dummy_wnd->Show(false);
+ m_dummyWnd = new wxWindow(this, wxID_ANY, wxPoint(0,0), wxSize(0,0));
+ m_dummyWnd->SetSize(200, 200);
+ m_dummyWnd->Show(false);
m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT);
m_mgr.SetDockSizeConstraint(1.0, 1.0); // no dock size constraint
- m_mgr.AddPane(m_dummy_wnd,
+ m_mgr.AddPane(m_dummyWnd,
wxAuiPaneInfo().Name(wxT("dummy")).Bottom().CaptionVisible(false).Show(false));
m_mgr.Update();
void wxAuiNotebook::SetTabCtrlHeight(int height)
{
- m_requested_tabctrl_height = height;
+ m_requestedTabCtrlHeight = height;
// if window is already initialized, recalculate the tab height
- if (m_dummy_wnd)
+ if (m_dummyWnd)
{
UpdateTabCtrlHeight();
}
void wxAuiNotebook::SetUniformBitmapSize(const wxSize& size)
{
- m_requested_bmp_size = size;
+ m_requestedBmpSize = size;
// if window is already initialized, recalculate the tab height
- if (m_dummy_wnd)
+ if (m_dummyWnd)
{
UpdateTabCtrlHeight();
}
// if the tab control height needs to change, update
// all of our tab controls with the new height
- if (m_tab_ctrl_height == height)
+ if (m_tabCtrlHeight == height)
return false;
wxAuiTabArt* art = m_tabs.GetArtProvider();
- m_tab_ctrl_height = height;
+ m_tabCtrlHeight = height;
wxAuiPaneInfoArray& all_panes = m_mgr.GetAllPanes();
size_t i, pane_count = all_panes.GetCount();
continue;
wxTabFrame* tab_frame = (wxTabFrame*)pane.window;
wxAuiTabCtrl* tabctrl = tab_frame->m_tabs;
- tab_frame->SetTabCtrlHeight(m_tab_ctrl_height);
+ tab_frame->SetTabCtrlHeight(m_tabCtrlHeight);
tabctrl->SetArtProvider(art->Clone());
tab_frame->DoSizing();
}
{
info.MinSize(size);
info.BestSize(size);
- m_dummy_wnd->SetSize(size);
+ m_dummyWnd->SetSize(size);
}
}
// if a fixed tab ctrl height is specified,
// just return that instead of calculating a
// tab height
- if (m_requested_tabctrl_height != -1)
- return m_requested_tabctrl_height;
+ if (m_requestedTabCtrlHeight != -1)
+ return m_requestedTabCtrlHeight;
// find out new best tab height
wxAuiTabArt* art = m_tabs.GetArtProvider();
return art->GetBestTabCtrlSize(this,
m_tabs.GetPages(),
- m_requested_bmp_size);
+ m_requestedBmpSize);
}
// (though no select events will be fired)
if (!select && m_tabs.GetPageCount() == 1)
select = true;
- //m_curpage = GetPageIndex(page);
+ //m_curPage = GetPageIndex(page);
wxAuiTabCtrl* active_tabctrl = GetActiveTabCtrl();
if (page_idx >= active_tabctrl->GetPageCount())
active_tabctrl->DoShowHide();
// adjust selected index
- if(m_curpage >= (int) page_idx)
- m_curpage++;
+ if(m_curPage >= (int) page_idx)
+ m_curPage++;
if (select)
{
{
// save active window pointer
wxWindow* active_wnd = NULL;
- if (m_curpage >= 0)
- active_wnd = m_tabs.GetWindowFromIdx(m_curpage);
+ if (m_curPage >= 0)
+ active_wnd = m_tabs.GetWindowFromIdx(m_curPage);
// save pointer of window being deleted
wxWindow* wnd = m_tabs.GetWindowFromIdx(page_idx);
if (!FindTab(wnd, &ctrl, &ctrl_idx))
return false;
- bool is_curpage = (m_curpage == (int)page_idx);
+ bool is_curpage = (m_curPage == (int)page_idx);
bool is_active_in_split = ctrl->GetPage(ctrl_idx).active;
RemoveEmptyTabFrames();
- m_curpage = wxNOT_FOUND;
+ m_curPage = wxNOT_FOUND;
// set new active pane unless we're being destroyed anyhow
if (new_active && !m_isBeingDeleted)
// GetSelection() returns the index of the currently active page
int wxAuiNotebook::GetSelection() const
{
- return m_curpage;
+ return m_curPage;
}
// SetSelection() sets the currently active page
// called to determine which control gets new windows being added
wxAuiTabCtrl* wxAuiNotebook::GetActiveTabCtrl()
{
- if (m_curpage >= 0 && m_curpage < (int)m_tabs.GetPageCount())
+ if (m_curPage >= 0 && m_curPage < (int)m_tabs.GetPageCount())
{
wxAuiTabCtrl* ctrl;
int idx;
// find the tab ctrl with the current page
- if (FindTab(m_tabs.GetPage(m_curpage).window,
+ if (FindTab(m_tabs.GetPage(m_curPage).window,
&ctrl, &idx))
{
return ctrl;
// If there is no tabframe at all, create one
wxTabFrame* tabframe = new wxTabFrame;
- tabframe->SetTabCtrlHeight(m_tab_ctrl_height);
+ tabframe->SetTabCtrlHeight(m_tabCtrlHeight);
tabframe->m_tabs = new wxAuiTabCtrl(this,
- m_tab_id_counter++,
+ m_tabIdCounter++,
wxDefaultPosition,
wxDefaultSize,
wxNO_BORDER|wxWANTS_CHARS);
// create a new tab frame
wxTabFrame* new_tabs = new wxTabFrame;
new_tabs->m_rect = wxRect(wxPoint(0,0), split_size);
- new_tabs->SetTabCtrlHeight(m_tab_ctrl_height);
+ new_tabs->SetTabCtrlHeight(m_tabCtrlHeight);
new_tabs->m_tabs = new wxAuiTabCtrl(this,
- m_tab_id_counter++,
+ m_tabIdCounter++,
wxDefaultPosition,
wxDefaultSize,
wxNO_BORDER|wxWANTS_CHARS);
// create a pane info structure with the information
// about where the pane should be added
- wxAuiPaneInfo pane_info = wxAuiPaneInfo().Bottom().CaptionVisible(false);
+ wxAuiPaneInfo paneInfo = wxAuiPaneInfo().Bottom().CaptionVisible(false);
wxPoint mouse_pt;
if (direction == wxLEFT)
{
- pane_info.Left();
+ paneInfo.Left();
mouse_pt = wxPoint(0, cli_size.y/2);
}
else if (direction == wxRIGHT)
{
- pane_info.Right();
+ paneInfo.Right();
mouse_pt = wxPoint(cli_size.x, cli_size.y/2);
}
else if (direction == wxTOP)
{
- pane_info.Top();
+ paneInfo.Top();
mouse_pt = wxPoint(cli_size.x/2, 0);
}
else if (direction == wxBOTTOM)
{
- pane_info.Bottom();
+ paneInfo.Bottom();
mouse_pt = wxPoint(cli_size.x/2, cli_size.y);
}
- m_mgr.AddPane(new_tabs, pane_info, mouse_pt);
+ m_mgr.AddPane(new_tabs, paneInfo, mouse_pt);
m_mgr.Update();
// remove the page from the source tabs
dest_tabs->Refresh();
// force the set selection function reset the selection
- m_curpage = -1;
+ m_curPage = -1;
// set the active page to the one we just split off
SetSelectionToPage(page_info);
void wxAuiNotebook::OnTabBeginDrag(wxAuiNotebookEvent&)
{
- m_last_drag_x = 0;
+ m_lastDragX = 0;
}
void wxAuiNotebook::OnTabDragMotion(wxAuiNotebookEvent& evt)
// prevent jumpy drag
if ((src_idx == dest_idx) || dest_idx == -1 ||
- (src_idx > dest_idx && m_last_drag_x <= pt.x) ||
- (src_idx < dest_idx && m_last_drag_x >= pt.x))
+ (src_idx > dest_idx && m_lastDragX <= pt.x) ||
+ (src_idx < dest_idx && m_lastDragX >= pt.x))
{
- m_last_drag_x = pt.x;
+ m_lastDragX = pt.x;
return;
}
dest_tabs->SetActivePage((size_t)dest_idx);
dest_tabs->DoShowHide();
dest_tabs->Refresh();
- m_last_drag_x = pt.x;
+ m_lastDragX = pt.x;
}
}
else
{
- m_mgr.DrawHintRect(m_dummy_wnd, client_pt, zero);
+ m_mgr.DrawHintRect(m_dummyWnd, client_pt, zero);
}
}
else
{
wxPoint zero(0,0);
- wxRect rect = m_mgr.CalculateHintRect(m_dummy_wnd,
+ wxRect rect = m_mgr.CalculateHintRect(m_dummyWnd,
mouse_client_pt,
zero);
if (rect.IsEmpty())
// If there is no tabframe at all, create one
wxTabFrame* new_tabs = new wxTabFrame;
new_tabs->m_rect = wxRect(wxPoint(0,0), CalculateNewSplitSize());
- new_tabs->SetTabCtrlHeight(m_tab_ctrl_height);
+ new_tabs->SetTabCtrlHeight(m_tabCtrlHeight);
new_tabs->m_tabs = new wxAuiTabCtrl(this,
- m_tab_id_counter++,
+ m_tabIdCounter++,
wxDefaultPosition,
wxDefaultSize,
wxNO_BORDER|wxWANTS_CHARS);
dest_tabs->Refresh();
// force the set selection function reset the selection
- m_curpage = -1;
+ m_curPage = -1;
// set the active page to the one we just split off
SetSelectionToPage(page_info);
// change the tab selection to the child
// which was focused
int idx = m_tabs.GetIdxFromWindow(evt.GetWindow());
- if (idx != -1 && idx != m_curpage)
+ if (idx != -1 && idx != m_curPage)
{
SetSelection(idx);
}
// Sets the normal font
void wxAuiNotebook::SetNormalFont(const wxFont& font)
{
- m_normal_font = font;
+ m_normalFont = font;
GetArtProvider()->SetNormalFont(font);
}
// Sets the selected tab font
void wxAuiNotebook::SetSelectedFont(const wxFont& font)
{
- m_selected_font = font;
+ m_selectedFont = font;
GetArtProvider()->SetSelectedFont(font);
}
// Gets the tab control height
int wxAuiNotebook::GetTabCtrlHeight() const
{
- return m_tab_ctrl_height;
+ return m_tabCtrlHeight;
}
// Gets the height of the notebook for a given page height
int wxAuiNotebook::DoModifySelection(size_t n, bool events)
{
- wxWindow* wnd = m_tabs.GetWindowFromIdx(n);
+ wxWindow* wnd = m_tabs.GetWindowFromIdx(n);
if (!wnd)
- return m_curpage;
+ return m_curPage;
// don't change the page unless necessary;
// however, clicking again on a tab should give it the focus.
- if ((int)n == m_curpage)
+ if ((int)n == m_curPage)
{
wxAuiTabCtrl* ctrl;
int ctrl_idx;
if (FindFocus() != ctrl)
ctrl->SetFocus();
}
- return m_curpage;
+ return m_curPage;
}
bool vetoed = false;
if(events)
{
evt.SetSelection(n);
- evt.SetOldSelection(m_curpage);
+ evt.SetOldSelection(m_curPage);
evt.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt);
vetoed = !evt.IsAllowed();
if (!vetoed)
{
- int old_curpage = m_curpage;
- m_curpage = n;
+ int old_curpage = m_curPage;
+ m_curPage = n;
// program allows the page change
if(events)
continue;
wxAuiTabCtrl* tabctrl = ((wxTabFrame*)pane.window)->m_tabs;
if (tabctrl != ctrl)
- tabctrl->SetSelectedFont(m_normal_font);
+ tabctrl->SetSelectedFont(m_normalFont);
else
- tabctrl->SetSelectedFont(m_selected_font);
+ tabctrl->SetSelectedFont(m_selectedFont);
tabctrl->Refresh();
}
}
}
- return m_curpage;
+ return m_curPage;
}
wxAuiDefaultDockArt::wxAuiDefaultDockArt()
{
#if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
- wxColor base_colour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
+ wxColor baseColour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground));
#else
- wxColor base_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
+ wxColor baseColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
#endif
- // the base_colour is too pale to use as our base colour,
+ // the baseColour is too pale to use as our base colour,
// so darken it a bit --
- if ((255-base_colour.Red()) +
- (255-base_colour.Green()) +
- (255-base_colour.Blue()) < 60)
+ if ((255-baseColour.Red()) +
+ (255-baseColour.Green()) +
+ (255-baseColour.Blue()) < 60)
{
- base_colour = base_colour.ChangeLightness(92);
+ baseColour = baseColour.ChangeLightness(92);
}
- m_base_colour = base_colour;
- wxColor darker1_colour = base_colour.ChangeLightness(85);
- wxColor darker2_colour = base_colour.ChangeLightness(75);
- wxColor darker3_colour = base_colour.ChangeLightness(60);
- //wxColor darker4_colour = base_colour.ChangeLightness(50);
- wxColor darker5_colour = base_colour.ChangeLightness(40);
-
- m_active_caption_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
- m_active_caption_gradient_colour = wxAuiLightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
- m_active_caption_text_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
- m_inactive_caption_colour = darker1_colour;
- m_inactive_caption_gradient_colour = base_colour.ChangeLightness(97);
- m_inactive_caption_text_colour = *wxBLACK;
-
- m_sash_brush = wxBrush(base_colour);
- m_background_brush = wxBrush(base_colour);
- m_gripper_brush = wxBrush(base_colour);
-
- m_border_pen = wxPen(darker2_colour);
- m_gripper_pen1 = wxPen(darker5_colour);
- m_gripper_pen2 = wxPen(darker3_colour);
- m_gripper_pen3 = *wxWHITE_PEN;
+ m_baseColour = baseColour;
+ wxColor darker1Colour = baseColour.ChangeLightness(85);
+ wxColor darker2Colour = baseColour.ChangeLightness(75);
+ wxColor darker3Colour = baseColour.ChangeLightness(60);
+ //wxColor darker4Colour = baseColour.ChangeLightness(50);
+ wxColor darker5Colour = baseColour.ChangeLightness(40);
+
+ m_activeCaptionColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
+ m_activeCaptionGradientColour = wxAuiLightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
+ m_activeCaptionTextColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
+ m_inactiveCaptionColour = darker1Colour;
+ m_inactiveCaptionGradientColour = baseColour.ChangeLightness(97);
+ m_inactiveCaptionTextColour = *wxBLACK;
+
+ m_sashBrush = wxBrush(baseColour);
+ m_backgroundBrush = wxBrush(baseColour);
+ m_gripperBrush = wxBrush(baseColour);
+
+ m_borderPen = wxPen(darker2Colour);
+ m_gripperPen1 = wxPen(darker5Colour);
+ m_gripperPen2 = wxPen(darker3Colour);
+ m_gripperPen3 = *wxWHITE_PEN;
#ifdef __WXMAC__
- m_caption_font = *wxSMALL_FONT;
+ m_captionFont = *wxSMALL_FONT;
#else
- m_caption_font = wxFont(8, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE);
+ m_captionFont = wxFont(8, wxDEFAULT, wxNORMAL, wxNORMAL, FALSE);
#endif
// default metric values
#if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON
SInt32 height;
GetThemeMetric( kThemeMetricSmallPaneSplitterHeight , &height );
- m_sash_size = height;
+ m_sashSize = height;
#elif defined(__WXGTK__)
- m_sash_size = wxRendererNative::Get().GetSplitterParams(NULL).widthSash;
+ m_sashSize = wxRendererNative::Get().GetSplitterParams(NULL).widthSash;
#else
- m_sash_size = 4;
+ m_sashSize = 4;
#endif
- m_caption_size = 17;
- m_border_size = 1;
- m_button_size = 14;
- m_gripper_size = 9;
- m_gradient_type = wxAUI_GRADIENT_VERTICAL;
+ m_captionSize = 17;
+ m_borderSize = 1;
+ m_buttonSize = 14;
+ m_gripperSize = 9;
+ m_gradientType = wxAUI_GRADIENT_VERTICAL;
InitBitmaps();
}
0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff};
#ifdef __WXMAC__
- m_inactive_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE);
- m_active_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE );
+ m_inactiveCloseBitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE);
+ m_activeCloseBitmap = wxAuiBitmapFromBits(close_bits, 16, 16, *wxWHITE );
#else
- m_inactive_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_inactive_caption_text_colour);
- m_active_close_bitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_active_caption_text_colour);
+ m_inactiveCloseBitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_inactiveCaptionTextColour);
+ m_activeCloseBitmap = wxAuiBitmapFromBits(close_bits, 16, 16, m_activeCaptionTextColour);
#endif
#ifdef __WXMAC__
- m_inactive_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE);
- m_active_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE );
+ m_inactiveMaximizeBitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE);
+ m_activeMaximizeBitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, *wxWHITE );
#else
- m_inactive_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_inactive_caption_text_colour);
- m_active_maximize_bitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_active_caption_text_colour);
+ m_inactiveMaximizeBitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_inactiveCaptionTextColour);
+ m_activeMaximizeBitmap = wxAuiBitmapFromBits(maximize_bits, 16, 16, m_activeCaptionTextColour);
#endif
#ifdef __WXMAC__
- m_inactive_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE);
- m_active_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE );
+ m_inactiveRestoreBitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE);
+ m_activeRestoreBitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, *wxWHITE );
#else
- m_inactive_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_inactive_caption_text_colour);
- m_active_restore_bitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_active_caption_text_colour);
+ m_inactiveRestoreBitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_inactiveCaptionTextColour);
+ m_activeRestoreBitmap = wxAuiBitmapFromBits(restore_bits, 16, 16, m_activeCaptionTextColour);
#endif
- m_inactive_pin_bitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_inactive_caption_text_colour);
- m_active_pin_bitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_active_caption_text_colour);
+ m_inactivePinBitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_inactiveCaptionTextColour);
+ m_activePinBitmap = wxAuiBitmapFromBits(pin_bits, 16, 16, m_activeCaptionTextColour);
}
int wxAuiDefaultDockArt::GetMetric(int id)
{
switch (id)
{
- case wxAUI_DOCKART_SASH_SIZE: return m_sash_size;
- case wxAUI_DOCKART_CAPTION_SIZE: return m_caption_size;
- case wxAUI_DOCKART_GRIPPER_SIZE: return m_gripper_size;
- case wxAUI_DOCKART_PANE_BORDER_SIZE: return m_border_size;
- case wxAUI_DOCKART_PANE_BUTTON_SIZE: return m_button_size;
- case wxAUI_DOCKART_GRADIENT_TYPE: return m_gradient_type;
+ case wxAUI_DOCKART_SASH_SIZE: return m_sashSize;
+ case wxAUI_DOCKART_CAPTION_SIZE: return m_captionSize;
+ case wxAUI_DOCKART_GRIPPER_SIZE: return m_gripperSize;
+ case wxAUI_DOCKART_PANE_BORDER_SIZE: return m_borderSize;
+ case wxAUI_DOCKART_PANE_BUTTON_SIZE: return m_buttonSize;
+ case wxAUI_DOCKART_GRADIENT_TYPE: return m_gradientType;
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
}
{
switch (id)
{
- case wxAUI_DOCKART_SASH_SIZE: m_sash_size = new_val; break;
- case wxAUI_DOCKART_CAPTION_SIZE: m_caption_size = new_val; break;
- case wxAUI_DOCKART_GRIPPER_SIZE: m_gripper_size = new_val; break;
- case wxAUI_DOCKART_PANE_BORDER_SIZE: m_border_size = new_val; break;
- case wxAUI_DOCKART_PANE_BUTTON_SIZE: m_button_size = new_val; break;
- case wxAUI_DOCKART_GRADIENT_TYPE: m_gradient_type = new_val; break;
+ case wxAUI_DOCKART_SASH_SIZE: m_sashSize = new_val; break;
+ case wxAUI_DOCKART_CAPTION_SIZE: m_captionSize = new_val; break;
+ case wxAUI_DOCKART_GRIPPER_SIZE: m_gripperSize = new_val; break;
+ case wxAUI_DOCKART_PANE_BORDER_SIZE: m_borderSize = new_val; break;
+ case wxAUI_DOCKART_PANE_BUTTON_SIZE: m_buttonSize = new_val; break;
+ case wxAUI_DOCKART_GRADIENT_TYPE: m_gradientType = new_val; break;
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
}
}
{
switch (id)
{
- case wxAUI_DOCKART_BACKGROUND_COLOUR: return m_background_brush.GetColour();
- case wxAUI_DOCKART_SASH_COLOUR: return m_sash_brush.GetColour();
- case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR: return m_inactive_caption_colour;
- case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR: return m_inactive_caption_gradient_colour;
- case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR: return m_inactive_caption_text_colour;
- case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR: return m_active_caption_colour;
- case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR: return m_active_caption_gradient_colour;
- case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR: return m_active_caption_text_colour;
- case wxAUI_DOCKART_BORDER_COLOUR: return m_border_pen.GetColour();
- case wxAUI_DOCKART_GRIPPER_COLOUR: return m_gripper_brush.GetColour();
+ case wxAUI_DOCKART_BACKGROUND_COLOUR: return m_backgroundBrush.GetColour();
+ case wxAUI_DOCKART_SASH_COLOUR: return m_sashBrush.GetColour();
+ case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR: return m_inactiveCaptionColour;
+ case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR: return m_inactiveCaptionGradientColour;
+ case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR: return m_inactiveCaptionTextColour;
+ case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR: return m_activeCaptionColour;
+ case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR: return m_activeCaptionGradientColour;
+ case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR: return m_activeCaptionTextColour;
+ case wxAUI_DOCKART_BORDER_COLOUR: return m_borderPen.GetColour();
+ case wxAUI_DOCKART_GRIPPER_COLOUR: return m_gripperBrush.GetColour();
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
}
{
switch (id)
{
- case wxAUI_DOCKART_BACKGROUND_COLOUR: m_background_brush.SetColour(colour); break;
- case wxAUI_DOCKART_SASH_COLOUR: m_sash_brush.SetColour(colour); break;
- case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR: m_inactive_caption_colour = colour; break;
- case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR: m_inactive_caption_gradient_colour = colour; break;
- case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR: m_inactive_caption_text_colour = colour; break;
- case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR: m_active_caption_colour = colour; break;
- case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR: m_active_caption_gradient_colour = colour; break;
- case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR: m_active_caption_text_colour = colour; break;
- case wxAUI_DOCKART_BORDER_COLOUR: m_border_pen.SetColour(colour); break;
+ case wxAUI_DOCKART_BACKGROUND_COLOUR: m_backgroundBrush.SetColour(colour); break;
+ case wxAUI_DOCKART_SASH_COLOUR: m_sashBrush.SetColour(colour); break;
+ case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR: m_inactiveCaptionColour = colour; break;
+ case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR: m_inactiveCaptionGradientColour = colour; break;
+ case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR: m_inactiveCaptionTextColour = colour; break;
+ case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR: m_activeCaptionColour = colour; break;
+ case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR: m_activeCaptionGradientColour = colour; break;
+ case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR: m_activeCaptionTextColour = colour; break;
+ case wxAUI_DOCKART_BORDER_COLOUR: m_borderPen.SetColour(colour); break;
case wxAUI_DOCKART_GRIPPER_COLOUR:
- m_gripper_brush.SetColour(colour);
- m_gripper_pen1.SetColour(colour.ChangeLightness(40));
- m_gripper_pen2.SetColour(colour.ChangeLightness(60));
+ m_gripperBrush.SetColour(colour);
+ m_gripperPen1.SetColour(colour.ChangeLightness(40));
+ m_gripperPen2.SetColour(colour.ChangeLightness(60));
break;
default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break;
}
void wxAuiDefaultDockArt::SetFont(int id, const wxFont& font)
{
if (id == wxAUI_DOCKART_CAPTION_FONT)
- m_caption_font = font;
+ m_captionFont = font;
}
wxFont wxAuiDefaultDockArt::GetFont(int id)
{
if (id == wxAUI_DOCKART_CAPTION_FONT)
- return m_caption_font;
+ return m_captionFont;
return wxNullFont;
}
#elif defined(__WXGTK__)
// clear out the rectangle first
dc.SetPen(*wxTRANSPARENT_PEN);
- dc.SetBrush(m_sash_brush);
+ dc.SetBrush(m_sashBrush);
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
#if 0
{
gdk_rect.x = rect.x;
gdk_rect.y = rect.y;
- gdk_rect.width = m_sash_size;
+ gdk_rect.width = m_sashSize;
gdk_rect.height = rect.height;
}
else
gdk_rect.x = rect.x;
gdk_rect.y = rect.y;
gdk_rect.width = rect.width;
- gdk_rect.height = m_sash_size;
+ gdk_rect.height = m_sashSize;
}
#endif
wxUnusedVar(window);
wxUnusedVar(orientation);
dc.SetPen(*wxTRANSPARENT_PEN);
- dc.SetBrush(m_sash_brush);
+ dc.SetBrush(m_sashBrush);
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
#endif
}
dc.SetBrush(*wxWHITE_BRUSH) ;
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
#endif
- dc.SetBrush(m_background_brush);
+ dc.SetBrush(m_backgroundBrush);
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
}
void wxAuiDefaultDockArt::DrawBorder(wxDC& dc, wxWindow *WXUNUSED(window), const wxRect& _rect,
wxAuiPaneInfo& pane)
{
- dc.SetPen(m_border_pen);
+ dc.SetPen(m_borderPen);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
wxRect rect = _rect;
dc.SetPen(*wxWHITE_PEN);
dc.DrawLine(rect.x, rect.y, rect.x+rect.width, rect.y);
dc.DrawLine(rect.x, rect.y, rect.x, rect.y+rect.height);
- dc.SetPen(m_border_pen);
+ dc.SetPen(m_borderPen);
dc.DrawLine(rect.x, rect.y+rect.height-1,
rect.x+rect.width, rect.y+rect.height-1);
dc.DrawLine(rect.x+rect.width-1, rect.y,
void wxAuiDefaultDockArt::DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active)
{
- if (m_gradient_type == wxAUI_GRADIENT_NONE)
+ if (m_gradientType == wxAUI_GRADIENT_NONE)
{
if (active)
- dc.SetBrush(wxBrush(m_active_caption_colour));
+ dc.SetBrush(wxBrush(m_activeCaptionColour));
else
- dc.SetBrush(wxBrush(m_inactive_caption_colour));
+ dc.SetBrush(wxBrush(m_inactiveCaptionColour));
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
}
// on mac the gradients are expected to become darker from the top
#ifdef __WXMAC__
DrawGradientRectangle(dc, rect,
- m_active_caption_colour,
- m_active_caption_gradient_colour,
- m_gradient_type);
+ m_activeCaptionColour,
+ m_activeCaptionGradientColour,
+ m_gradientType);
#else
// on other platforms, active gradients become lighter at the top
DrawGradientRectangle(dc, rect,
- m_active_caption_gradient_colour,
- m_active_caption_colour,
- m_gradient_type);
+ m_activeCaptionGradientColour,
+ m_activeCaptionColour,
+ m_gradientType);
#endif
}
else
#ifdef __WXMAC__
// on mac the gradients are expected to become darker from the top
DrawGradientRectangle(dc, rect,
- m_inactive_caption_gradient_colour,
- m_inactive_caption_colour,
- m_gradient_type);
+ m_inactiveCaptionGradientColour,
+ m_inactiveCaptionColour,
+ m_gradientType);
#else
// on other platforms, inactive gradients become lighter at the bottom
DrawGradientRectangle(dc, rect,
- m_inactive_caption_colour,
- m_inactive_caption_gradient_colour,
- m_gradient_type);
+ m_inactiveCaptionColour,
+ m_inactiveCaptionGradientColour,
+ m_gradientType);
#endif
}
}
wxAuiPaneInfo& pane)
{
dc.SetPen(*wxTRANSPARENT_PEN);
- dc.SetFont(m_caption_font);
+ dc.SetFont(m_captionFont);
DrawCaptionBackground(dc, rect,
(pane.state & wxAuiPaneInfo::optionActive)?true:false);
}
if (pane.state & wxAuiPaneInfo::optionActive)
- dc.SetTextForeground(m_active_caption_text_colour);
+ dc.SetTextForeground(m_activeCaptionTextColour);
else
- dc.SetTextForeground(m_inactive_caption_text_colour);
+ dc.SetTextForeground(m_inactiveCaptionTextColour);
wxCoord w,h;
clip_rect.width -= 3; // text offset
clip_rect.width -= 2; // button padding
if (pane.HasCloseButton())
- clip_rect.width -= m_button_size;
+ clip_rect.width -= m_buttonSize;
if (pane.HasPinButton())
- clip_rect.width -= m_button_size;
+ clip_rect.width -= m_buttonSize;
if (pane.HasMaximizeButton())
- clip_rect.width -= m_button_size;
+ clip_rect.width -= m_buttonSize;
wxString draw_text = wxAuiChopText(dc, text, clip_rect.width);
wxAuiPaneInfo& pane)
{
dc.SetPen(*wxTRANSPARENT_PEN);
- dc.SetBrush(m_gripper_brush);
+ dc.SetBrush(m_gripperBrush);
dc.DrawRectangle(rect.x, rect.y, rect.width,rect.height);
int y = 5;
while (1)
{
- dc.SetPen(m_gripper_pen1);
+ dc.SetPen(m_gripperPen1);
dc.DrawPoint(rect.x+3, rect.y+y);
- dc.SetPen(m_gripper_pen2);
+ dc.SetPen(m_gripperPen2);
dc.DrawPoint(rect.x+3, rect.y+y+1);
dc.DrawPoint(rect.x+4, rect.y+y);
- dc.SetPen(m_gripper_pen3);
+ dc.SetPen(m_gripperPen3);
dc.DrawPoint(rect.x+5, rect.y+y+1);
dc.DrawPoint(rect.x+5, rect.y+y+2);
dc.DrawPoint(rect.x+4, rect.y+y+2);
int x = 5;
while (1)
{
- dc.SetPen(m_gripper_pen1);
+ dc.SetPen(m_gripperPen1);
dc.DrawPoint(rect.x+x, rect.y+3);
- dc.SetPen(m_gripper_pen2);
+ dc.SetPen(m_gripperPen2);
dc.DrawPoint(rect.x+x+1, rect.y+3);
dc.DrawPoint(rect.x+x, rect.y+4);
- dc.SetPen(m_gripper_pen3);
+ dc.SetPen(m_gripperPen3);
dc.DrawPoint(rect.x+x+1, rect.y+5);
dc.DrawPoint(rect.x+x+2, rect.y+5);
dc.DrawPoint(rect.x+x+2, rect.y+4);
default:
case wxAUI_BUTTON_CLOSE:
if (pane.state & wxAuiPaneInfo::optionActive)
- bmp = m_active_close_bitmap;
+ bmp = m_activeCloseBitmap;
else
- bmp = m_inactive_close_bitmap;
+ bmp = m_inactiveCloseBitmap;
break;
case wxAUI_BUTTON_PIN:
if (pane.state & wxAuiPaneInfo::optionActive)
- bmp = m_active_pin_bitmap;
+ bmp = m_activePinBitmap;
else
- bmp = m_inactive_pin_bitmap;
+ bmp = m_inactivePinBitmap;
break;
case wxAUI_BUTTON_MAXIMIZE_RESTORE:
if (pane.IsMaximized())
{
if (pane.state & wxAuiPaneInfo::optionActive)
- bmp = m_active_restore_bitmap;
+ bmp = m_activeRestoreBitmap;
else
- bmp = m_inactive_restore_bitmap;
+ bmp = m_inactiveRestoreBitmap;
}
else
{
if (pane.state & wxAuiPaneInfo::optionActive)
- bmp = m_active_maximize_bitmap;
+ bmp = m_activeMaximizeBitmap;
else
- bmp = m_inactive_maximize_bitmap;
+ bmp = m_inactiveMaximizeBitmap;
}
break;
}
{
if (pane.state & wxAuiPaneInfo::optionActive)
{
- dc.SetBrush(wxBrush(m_active_caption_colour.ChangeLightness(120)));
- dc.SetPen(wxPen(m_active_caption_colour.ChangeLightness(70)));
+ dc.SetBrush(wxBrush(m_activeCaptionColour.ChangeLightness(120)));
+ dc.SetPen(wxPen(m_activeCaptionColour.ChangeLightness(70)));
}
else
{
- dc.SetBrush(wxBrush(m_inactive_caption_colour.ChangeLightness(120)));
- dc.SetPen(wxPen(m_inactive_caption_colour.ChangeLightness(70)));
+ dc.SetBrush(wxBrush(m_inactiveCaptionColour.ChangeLightness(120)));
+ dc.SetPen(wxPen(m_inactiveCaptionColour.ChangeLightness(70)));
}
// draw the background behind the button
(pane.IsFixed()?0:wxRESIZE_BORDER)
)
{
- m_owner_mgr = owner_mgr;
+ m_ownerMgr = owner_mgr;
m_moving = false;
m_mgr.SetManagedWindow(this);
- m_solid_drag = true;
+ m_solidDrag = true;
// find out if the system supports solid window drag.
// on non-msw systems, this is assumed to be the case
#ifdef __WXMSW__
BOOL b = TRUE;
SystemParametersInfo(38 /*SPI_GETDRAGFULLWINDOWS*/, 0, &b, 0);
- m_solid_drag = b ? true : false;
+ m_solidDrag = b ? true : false;
#endif
SetExtraStyle(wxWS_EX_PROCESS_IDLE);
wxAuiFloatingFrame::~wxAuiFloatingFrame()
{
// if we do not do this, then we can crash...
- if (m_owner_mgr && m_owner_mgr->m_action_window == this)
+ if (m_ownerMgr && m_ownerMgr->m_actionWindow == this)
{
- m_owner_mgr->m_action_window = NULL;
+ m_ownerMgr->m_actionWindow = NULL;
}
m_mgr.UnInit();
void wxAuiFloatingFrame::SetPaneWindow(const wxAuiPaneInfo& pane)
{
- m_pane_window = pane.window;
- m_pane_window->Reparent(this);
+ m_paneWindow = pane.window;
+ m_paneWindow->Reparent(this);
wxAuiPaneInfo contained_pane = pane;
contained_pane.Dock().Center().Show().
SetMinSize(pane.window->GetMinSize());
- m_mgr.AddPane(m_pane_window, contained_pane);
+ m_mgr.AddPane(m_paneWindow, contained_pane);
m_mgr.Update();
if (pane.min_size.IsFullySpecified())
if (size == wxDefaultSize)
size = pane.min_size;
if (size == wxDefaultSize)
- size = m_pane_window->GetSize();
- if (m_owner_mgr && pane.HasGripper())
+ size = m_paneWindow->GetSize();
+ if (m_ownerMgr && pane.HasGripper())
{
if (pane.HasGripperTop())
- size.y += m_owner_mgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
+ size.y += m_ownerMgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
else
- size.x += m_owner_mgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
+ size.x += m_ownerMgr->m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
}
SetClientSize(size);
wxAuiManager* wxAuiFloatingFrame::GetOwnerManager() const
{
- return m_owner_mgr;
+ return m_ownerMgr;
}
void wxAuiFloatingFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{
- if (m_owner_mgr)
+ if (m_ownerMgr)
{
- m_owner_mgr->OnFloatingPaneResized(m_pane_window, GetRect());
+ m_ownerMgr->OnFloatingPaneResized(m_paneWindow, GetRect());
}
}
void wxAuiFloatingFrame::OnClose(wxCloseEvent& evt)
{
- if (m_owner_mgr)
+ if (m_ownerMgr)
{
- m_owner_mgr->OnFloatingPaneClosed(m_pane_window, evt);
+ m_ownerMgr->OnFloatingPaneClosed(m_paneWindow, evt);
}
if (!evt.GetVeto())
{
- m_mgr.DetachPane(m_pane_window);
+ m_mgr.DetachPane(m_paneWindow);
Destroy();
}
}
void wxAuiFloatingFrame::OnMoveEvent(wxMoveEvent& event)
{
- if (!m_solid_drag)
+ if (!m_solidDrag)
{
// systems without solid window dragging need to be
// handled slightly differently, due to the lack of
}
- wxRect win_rect = GetRect();
+ wxRect winRect = GetRect();
- if (win_rect == m_last_rect)
+ if (winRect == m_lastRect)
return;
// skip the first move event
- if (m_last_rect.IsEmpty())
+ if (m_lastRect.IsEmpty())
{
- m_last_rect = win_rect;
+ m_lastRect = winRect;
return;
}
// skip if moving too fast to avoid massive redraws and
// jumping hint windows
- if ((abs(win_rect.x - m_last_rect.x) > 3) ||
- (abs(win_rect.y - m_last_rect.y) > 3))
+ if ((abs(winRect.x - m_lastRect.x) > 3) ||
+ (abs(winRect.y - m_lastRect.y) > 3))
{
- m_last3_rect = m_last2_rect;
- m_last2_rect = m_last_rect;
- m_last_rect = win_rect;
+ m_last3Rect = m_last2Rect;
+ m_last2Rect = m_lastRect;
+ m_lastRect = winRect;
// However still update the internally stored position to avoid
// snapping back to the old one later.
- if (m_owner_mgr)
+ if (m_ownerMgr)
{
- m_owner_mgr->GetPane(m_pane_window).
- floating_pos = win_rect.GetPosition();
+ m_ownerMgr->GetPane(m_paneWindow).
+ floating_pos = winRect.GetPosition();
}
return;
}
// prevent frame redocking during resize
- if (m_last_rect.GetSize() != win_rect.GetSize())
+ if (m_lastRect.GetSize() != winRect.GetSize())
{
- m_last3_rect = m_last2_rect;
- m_last2_rect = m_last_rect;
- m_last_rect = win_rect;
+ m_last3Rect = m_last2Rect;
+ m_last2Rect = m_lastRect;
+ m_lastRect = winRect;
return;
}
wxDirection dir = wxALL;
- int horiz_dist = abs(win_rect.x - m_last3_rect.x);
- int vert_dist = abs(win_rect.y - m_last3_rect.y);
+ int horiz_dist = abs(winRect.x - m_last3Rect.x);
+ int vert_dist = abs(winRect.y - m_last3Rect.y);
if (vert_dist >= horiz_dist)
{
- if (win_rect.y < m_last3_rect.y)
+ if (winRect.y < m_last3Rect.y)
dir = wxNORTH;
else
dir = wxSOUTH;
}
else
{
- if (win_rect.x < m_last3_rect.x)
+ if (winRect.x < m_last3Rect.x)
dir = wxWEST;
else
dir = wxEAST;
}
- m_last3_rect = m_last2_rect;
- m_last2_rect = m_last_rect;
- m_last_rect = win_rect;
+ m_last3Rect = m_last2Rect;
+ m_last2Rect = m_lastRect;
+ m_lastRect = winRect;
if (!isMouseDown())
return;
m_moving = true;
}
- if (m_last3_rect.IsEmpty())
+ if (m_last3Rect.IsEmpty())
return;
OnMoving(event.GetRect(), dir);
void wxAuiFloatingFrame::OnMoveStart()
{
// notify the owner manager that the pane has started to move
- if (m_owner_mgr)
+ if (m_ownerMgr)
{
- m_owner_mgr->OnFloatingPaneMoveStart(m_pane_window);
+ m_ownerMgr->OnFloatingPaneMoveStart(m_paneWindow);
}
}
void wxAuiFloatingFrame::OnMoving(const wxRect& WXUNUSED(window_rect), wxDirection dir)
{
// notify the owner manager that the pane is moving
- if (m_owner_mgr)
+ if (m_ownerMgr)
{
- m_owner_mgr->OnFloatingPaneMoving(m_pane_window, dir);
+ m_ownerMgr->OnFloatingPaneMoving(m_paneWindow, dir);
}
m_lastDirection = dir;
}
void wxAuiFloatingFrame::OnMoveFinished()
{
// notify the owner manager that the pane has finished moving
- if (m_owner_mgr)
+ if (m_ownerMgr)
{
- m_owner_mgr->OnFloatingPaneMoved(m_pane_window, m_lastDirection);
+ m_ownerMgr->OnFloatingPaneMoved(m_paneWindow, m_lastDirection);
}
}
void wxAuiFloatingFrame::OnActivate(wxActivateEvent& event)
{
- if (m_owner_mgr && event.GetActive())
+ if (m_ownerMgr && event.GetActive())
{
- m_owner_mgr->OnFloatingPaneActivated(m_pane_window);
+ m_ownerMgr->OnFloatingPaneActivated(m_paneWindow);
}
}
: wxFrame(parent, id, title, pos, size, style | wxFRAME_SHAPED, name)
{
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
- m_Amount=0;
- m_MaxWidth=0;
- m_MaxHeight=0;
+ m_amount=0;
+ m_maxWidth=0;
+ m_maxHeight=0;
m_lastWidth=0;
m_lastHeight=0;
#ifdef __WXGTK__
- m_CanSetShape = false; // have to wait for window create event on GTK
+ m_canSetShape = false; // have to wait for window create event on GTK
#else
- m_CanSetShape = true;
+ m_canSetShape = true;
#endif
- m_Region = wxRegion(0, 0, 0, 0);
+ m_region = wxRegion(0, 0, 0, 0);
SetTransparent(0);
}
virtual bool SetTransparent(wxByte alpha)
{
- if (m_CanSetShape)
+ if (m_canSetShape)
{
int w=100; // some defaults
int h=100;
GetClientSize(&w, &h);
- m_MaxWidth = w;
- m_MaxHeight = h;
- m_Amount = alpha;
- m_Region.Clear();
-// m_Region.Union(0, 0, 1, m_MaxWidth);
- if (m_Amount)
+ m_maxWidth = w;
+ m_maxHeight = h;
+ m_amount = alpha;
+ m_region.Clear();
+// m_region.Union(0, 0, 1, m_maxWidth);
+ if (m_amount)
{
- for (int y=0; y<m_MaxHeight; y++)
+ for (int y=0; y<m_maxHeight; y++)
{
// Reverse the order of the bottom 4 bits
int j=((y&8)?1:0)|((y&4)?2:0)|((y&2)?4:0)|((y&1)?8:0);
- if ((j*16+8)<m_Amount)
- m_Region.Union(0, y, m_MaxWidth, 1);
+ if ((j*16+8)<m_amount)
+ m_region.Union(0, y, m_maxWidth, 1);
}
}
- SetShape(m_Region);
+ SetShape(m_region);
Refresh();
}
return true;
{
wxPaintDC dc(this);
- if (m_Region.IsEmpty())
+ if (m_region.IsEmpty())
return;
#ifdef __WXMAC__
#ifdef __WXGTK__
void OnWindowCreate(wxWindowCreateEvent& WXUNUSED(event))
{
- m_CanSetShape=true;
+ m_canSetShape=true;
SetTransparent(0);
}
#endif
m_lastWidth = event.GetSize().GetWidth();
m_lastHeight = event.GetSize().GetHeight();
- SetTransparent(m_Amount);
- m_Region.Intersect(0, 0, event.GetSize().GetWidth(),
+ SetTransparent(m_amount);
+ m_region.Intersect(0, 0, event.GetSize().GetWidth(),
event.GetSize().GetHeight());
- SetShape(m_Region);
+ SetShape(m_region);
Refresh();
event.Skip();
}
private:
- wxByte m_Amount;
- int m_MaxWidth;
- int m_MaxHeight;
- bool m_CanSetShape;
+ wxByte m_amount;
+ int m_maxWidth;
+ int m_maxHeight;
+ bool m_canSetShape;
int m_lastWidth,m_lastHeight;
- wxRegion m_Region;
+ wxRegion m_region;
DECLARE_DYNAMIC_CLASS(wxPseudoTransparentFrame)
DECLARE_EVENT_TABLE()
wxAuiManager::wxAuiManager(wxWindow* managed_wnd, unsigned int flags)
{
m_action = actionNone;
- m_action_window = NULL;
- m_last_mouse_move = wxPoint();
- m_hover_button = NULL;
+ m_actionWindow = NULL;
+ m_lastMouseMove = wxPoint();
+ m_hoverButton = NULL;
m_art = new wxAuiDefaultDockArt;
- m_hint_wnd = NULL;
+ m_hintWnd = NULL;
m_flags = flags;
m_skipping = false;
- m_has_maximized = false;
+ m_hasMaximized = false;
m_frame = NULL;
- m_dock_constraint_x = 0.3;
- m_dock_constraint_y = 0.3;
+ m_dockConstraintX = 0.3;
+ m_dockConstraintY = 0.3;
m_reserved = NULL;
m_currentDragItem = -1;
// creates a floating frame for the windows
wxAuiFloatingFrame* wxAuiManager::CreateFloatingFrame(wxWindow* parent,
- const wxAuiPaneInfo& pane_info)
+ const wxAuiPaneInfo& paneInfo)
{
- return new wxAuiFloatingFrame(parent, this, pane_info);
+ return new wxAuiFloatingFrame(parent, this, paneInfo);
}
bool wxAuiManager::CanDockPanel(const wxAuiPaneInfo & WXUNUSED(p))
wxAuiDockUIPart* result = NULL;
int i, part_count;
- for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i)
+ for (i = 0, part_count = m_uiParts.GetCount(); i < part_count; ++i)
{
- wxAuiDockUIPart* item = &m_uiparts.Item(i);
+ wxAuiDockUIPart* item = &m_uiParts.Item(i);
// we are not interested in typeDock, because this space
// isn't used to draw anything, just for measurements;
}
// if there is an existing hint window, delete it
- if (m_hint_wnd)
+ if (m_hintWnd)
{
- m_hint_wnd->Destroy();
- m_hint_wnd = NULL;
+ m_hintWnd->Destroy();
+ m_hintWnd = NULL;
}
- m_hint_fademax = 50;
- m_hint_wnd = NULL;
+ m_hintFadeMax = 50;
+ m_hintWnd = NULL;
if ((m_flags & wxAUI_MGR_TRANSPARENT_HINT) && can_do_transparent)
{
// Make a window to use for a transparent hint
#if defined(__WXMSW__) || defined(__WXGTK__)
- m_hint_wnd = new wxFrame(m_frame, wxID_ANY, wxEmptyString,
+ m_hintWnd = new wxFrame(m_frame, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxSize(1,1),
wxFRAME_TOOL_WINDOW |
wxFRAME_FLOAT_ON_PARENT |
wxFRAME_NO_TASKBAR |
wxNO_BORDER);
- m_hint_wnd->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
+ m_hintWnd->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_ACTIVECAPTION));
#elif defined(__WXMAC__)
// Using a miniframe with float and tool styles keeps the parent
// frame activated and highlighted as such...
- m_hint_wnd = new wxMiniFrame(m_frame, wxID_ANY, wxEmptyString,
+ m_hintWnd = new wxMiniFrame(m_frame, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxSize(1,1),
wxFRAME_FLOAT_ON_PARENT
| wxFRAME_TOOL_WINDOW );
- m_hint_wnd->Connect(wxEVT_ACTIVATE,
+ m_hintWnd->Connect(wxEVT_ACTIVATE,
wxActivateEventHandler(wxAuiManager::OnHintActivate), NULL, this);
// Can't set the bg colour of a Frame in wxMac
- wxPanel* p = new wxPanel(m_hint_wnd);
+ wxPanel* p = new wxPanel(m_hintWnd);
// The default wxSYS_COLOUR_ACTIVECAPTION colour is a light silver
// color that is really hard to see, especially transparent.
{
// system can't support transparent fade, or the venetian
// blinds effect was explicitly requested
- m_hint_wnd = new wxPseudoTransparentFrame(m_frame,
+ m_hintWnd = new wxPseudoTransparentFrame(m_frame,
wxID_ANY,
wxEmptyString,
wxDefaultPosition,
wxFRAME_FLOAT_ON_PARENT |
wxFRAME_NO_TASKBAR |
wxNO_BORDER);
- m_hint_fademax = 128;
+ m_hintFadeMax = 128;
}
}
}
}
-bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
+bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& paneInfo)
{
wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed"));
return false;
// check if the window is already managed by us
- if (GetPane(pane_info.window).IsOk())
+ if (GetPane(paneInfo.window).IsOk())
return false;
// check if the pane name already exists, this could reveal a
// bug in the library user's application
bool already_exists = false;
- if (!pane_info.name.empty() && GetPane(pane_info.name).IsOk())
+ if (!paneInfo.name.empty() && GetPane(paneInfo.name).IsOk())
{
wxFAIL_MSG(wxT("A pane with that name already exists in the manager!"));
already_exists = true;
}
// if the new pane is docked then we should undo maximize
- if (pane_info.IsDocked())
+ if (paneInfo.IsDocked())
RestoreMaximizedPane();
// special case: wxAuiToolBar style interacts with docking flags
- wxAuiPaneInfo test(pane_info);
+ wxAuiPaneInfo test(paneInfo);
wxAuiToolBar* toolbar = wxDynamicCast(window, wxAuiToolBar);
if (toolbar)
{
}
bool wxAuiManager::AddPane(wxWindow* window,
- const wxAuiPaneInfo& pane_info,
+ const wxAuiPaneInfo& paneInfo,
const wxPoint& drop_pos)
{
- if (!AddPane(window, pane_info))
+ if (!AddPane(window, paneInfo))
return false;
wxAuiPaneInfo& pane = GetPane(window);
return true;
}
-bool wxAuiManager::InsertPane(wxWindow* window, const wxAuiPaneInfo& pane_info,
+bool wxAuiManager::InsertPane(wxWindow* window, const wxAuiPaneInfo& paneInfo,
int insert_level)
{
wxASSERT_MSG(window, wxT("NULL window ptrs are not allowed"));
{
case wxAUI_INSERT_PANE:
DoInsertPane(m_panes,
- pane_info.dock_direction,
- pane_info.dock_layer,
- pane_info.dock_row,
- pane_info.dock_pos);
+ paneInfo.dock_direction,
+ paneInfo.dock_layer,
+ paneInfo.dock_row,
+ paneInfo.dock_pos);
break;
case wxAUI_INSERT_ROW:
DoInsertDockRow(m_panes,
- pane_info.dock_direction,
- pane_info.dock_layer,
- pane_info.dock_row);
+ paneInfo.dock_direction,
+ paneInfo.dock_layer,
+ paneInfo.dock_row);
break;
case wxAUI_INSERT_DOCK:
DoInsertDockLayer(m_panes,
- pane_info.dock_direction,
- pane_info.dock_layer);
+ paneInfo.dock_direction,
+ paneInfo.dock_layer);
break;
}
wxAuiPaneInfo& existing_pane = GetPane(window);
if (!existing_pane.IsOk())
{
- return AddPane(window, pane_info);
+ return AddPane(window, paneInfo);
}
else
{
- if (pane_info.IsFloating())
+ if (paneInfo.IsFloating())
{
existing_pane.Float();
- if (pane_info.floating_pos != wxDefaultPosition)
- existing_pane.FloatingPosition(pane_info.floating_pos);
- if (pane_info.floating_size != wxDefaultSize)
- existing_pane.FloatingSize(pane_info.floating_size);
+ if (paneInfo.floating_pos != wxDefaultPosition)
+ existing_pane.FloatingPosition(paneInfo.floating_pos);
+ if (paneInfo.floating_size != wxDefaultSize)
+ existing_pane.FloatingSize(paneInfo.floating_size);
}
else
{
// if the new pane is docked then we should undo maximize
RestoreMaximizedPane();
- existing_pane.Direction(pane_info.dock_direction);
- existing_pane.Layer(pane_info.dock_layer);
- existing_pane.Row(pane_info.dock_row);
- existing_pane.Position(pane_info.dock_pos);
+ existing_pane.Direction(paneInfo.dock_direction);
+ existing_pane.Layer(paneInfo.dock_layer);
+ existing_pane.Row(paneInfo.dock_row);
+ existing_pane.Position(paneInfo.dock_pos);
}
}
p.frame->Show(false);
// reparent to m_frame and destroy the pane
- if (m_action_window == p.frame)
+ if (m_actionWindow == p.frame)
{
- m_action_window = NULL;
+ m_actionWindow = NULL;
}
p.window->Reparent(m_frame);
// the DetachPane() call. This prevets obscure crashes which would
// happen at window repaint if the caller forgets to call Update()
int pi, part_count;
- for (pi = 0, part_count = (int)m_uiparts.GetCount(); pi < part_count; ++pi)
+ for (pi = 0, part_count = (int)m_uiParts.GetCount(); pi < part_count; ++pi)
{
- wxAuiDockUIPart& part = m_uiparts.Item(pi);
+ wxAuiDockUIPart& part = m_uiParts.Item(pi);
if (part.pane == &p)
{
- m_uiparts.RemoveAt(pi);
+ m_uiParts.RemoveAt(pi);
part_count--;
pi--;
continue;
}
// ClosePane() destroys or hides the pane depending on its flags
-void wxAuiManager::ClosePane(wxAuiPaneInfo& pane_info)
+void wxAuiManager::ClosePane(wxAuiPaneInfo& paneInfo)
{
// if we were maximized, restore
- if (pane_info.IsMaximized())
+ if (paneInfo.IsMaximized())
{
- RestorePane(pane_info);
+ RestorePane(paneInfo);
}
// first, hide the window
- if (pane_info.window && pane_info.window->IsShown())
+ if (paneInfo.window && paneInfo.window->IsShown())
{
- pane_info.window->Show(false);
+ paneInfo.window->Show(false);
}
// make sure that we are the parent of this window
- if (pane_info.window && pane_info.window->GetParent() != m_frame)
+ if (paneInfo.window && paneInfo.window->GetParent() != m_frame)
{
- pane_info.window->Reparent(m_frame);
+ paneInfo.window->Reparent(m_frame);
}
// if we have a frame, destroy it
- if (pane_info.frame)
+ if (paneInfo.frame)
{
- pane_info.frame->Destroy();
- pane_info.frame = NULL;
+ paneInfo.frame->Destroy();
+ paneInfo.frame = NULL;
}
// now we need to either destroy or hide the pane
- if (pane_info.IsDestroyOnClose())
+ if (paneInfo.IsDestroyOnClose())
{
- wxWindow * window = pane_info.window;
+ wxWindow * window = paneInfo.window;
DetachPane(window);
if (window)
{
}
else
{
- pane_info.Hide();
+ paneInfo.Hide();
}
}
-void wxAuiManager::MaximizePane(wxAuiPaneInfo& pane_info)
+void wxAuiManager::MaximizePane(wxAuiPaneInfo& paneInfo)
{
int i, pane_count;
}
// mark ourselves maximized
- pane_info.Maximize();
- pane_info.Show();
- m_has_maximized = true;
+ paneInfo.Maximize();
+ paneInfo.Show();
+ m_hasMaximized = true;
// last, show the window
- if (pane_info.window && !pane_info.window->IsShown())
+ if (paneInfo.window && !paneInfo.window->IsShown())
{
- pane_info.window->Show(true);
+ paneInfo.window->Show(true);
}
}
-void wxAuiManager::RestorePane(wxAuiPaneInfo& pane_info)
+void wxAuiManager::RestorePane(wxAuiPaneInfo& paneInfo)
{
int i, pane_count;
}
// mark ourselves non-maximized
- pane_info.Restore();
- m_has_maximized = false;
+ paneInfo.Restore();
+ m_hasMaximized = false;
// last, show the window
- if (pane_info.window && !pane_info.window->IsShown())
+ if (paneInfo.window && !paneInfo.window->IsShown())
{
- pane_info.window->Show(true);
+ paneInfo.window->Show(true);
}
}
input.Replace(wxT("\\|"), wxT("\a"));
input.Replace(wxT("\\;"), wxT("\b"));
- m_has_maximized = false;
+ m_hasMaximized = false;
while (1)
{
wxAuiPaneInfo pane;
LoadPaneInfo(pane_part, pane);
if ( pane.IsMaximized() )
- m_has_maximized = true;
+ m_hasMaximized = true;
wxAuiPaneInfo& p = GetPane(pane.name);
if (!p.IsOk())
wxArrayInt& sizes)
{
int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE);
- int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
- int gripper_size = m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
+ int pane_borderSize = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
+ int gripperSize = m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
positions.Empty();
sizes.Empty();
int size = 0;
if (pane.HasBorder())
- size += (pane_border_size*2);
+ size += (pane_borderSize*2);
if (dock.IsHorizontal())
{
if (pane.HasGripper() && !pane.HasGripperTop())
- size += gripper_size;
+ size += gripperSize;
size += pane.best_size.x;
}
else
{
if (pane.HasGripper() && pane.HasGripperTop())
- size += gripper_size;
+ size += gripperSize;
if (pane.HasCaption())
size += caption_size;
wxSizerItem* sizer_item;
int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE);
- int gripper_size = m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
- int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
+ int gripperSize = m_art->GetMetric(wxAUI_DOCKART_GRIPPER_SIZE);
+ int pane_borderSize = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
int pane_button_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BUTTON_SIZE);
// find out the orientation of the item (orientation for panes
if (pane.HasGripper())
{
if (pane.HasGripperTop())
- sizer_item = vert_pane_sizer ->Add(1, gripper_size, 0, wxEXPAND);
+ sizer_item = vert_pane_sizer ->Add(1, gripperSize, 0, wxEXPAND);
else
- sizer_item = horz_pane_sizer ->Add(gripper_size, 1, 0, wxEXPAND);
+ sizer_item = horz_pane_sizer ->Add(gripperSize, 1, 0, wxEXPAND);
part.type = wxAuiDockUIPart::typeGripper;
part.dock = &dock;
{
// allowing space for the pane's border
sizer_item = cont->Add(horz_pane_sizer, pane_proportion,
- wxEXPAND | wxALL, pane_border_size);
+ wxEXPAND | wxALL, pane_borderSize);
part.type = wxAuiDockUIPart::typePaneBorder;
part.dock = &dock;
wxSizerItem* sizer_item;
wxAuiDockUIPart part;
- int sash_size = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE);
+ int sashSize = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE);
int orientation = dock.IsHorizontal() ? wxHORIZONTAL : wxVERTICAL;
// resizable bottom and right docks have a sash before them
- if (!m_has_maximized && !dock.fixed && (dock.dock_direction == wxAUI_DOCK_BOTTOM ||
+ if (!m_hasMaximized && !dock.fixed && (dock.dock_direction == wxAUI_DOCK_BOTTOM ||
dock.dock_direction == wxAUI_DOCK_RIGHT))
{
- sizer_item = cont->Add(sash_size, sash_size, 0, wxEXPAND);
+ sizer_item = cont->Add(sashSize, sashSize, 0, wxEXPAND);
part.type = wxAuiDockUIPart::typeDockSizer;
part.orientation = orientation;
// if this is not the first pane being added,
// we need to add a pane sizer
- if (!m_has_maximized && pane_i > 0)
+ if (!m_hasMaximized && pane_i > 0)
{
- sizer_item = dock_sizer->Add(sash_size, sash_size, 0, wxEXPAND);
+ sizer_item = dock_sizer->Add(sashSize, sashSize, 0, wxEXPAND);
part.type = wxAuiDockUIPart::typePaneSizer;
part.dock = &dock;
cont->SetItemMinSize(dock_sizer, dock.size, 0);
// top and left docks have a sash after them
- if (!m_has_maximized &&
+ if (!m_hasMaximized &&
!dock.fixed &&
(dock.dock_direction == wxAUI_DOCK_TOP ||
dock.dock_direction == wxAUI_DOCK_LEFT))
{
- sizer_item = cont->Add(sash_size, sash_size, 0, wxEXPAND);
+ sizer_item = cont->Add(sashSize, sashSize, 0, wxEXPAND);
part.type = wxAuiDockUIPart::typeDockSizer;
part.dock = &dock;
{
wxBoxSizer* container = new wxBoxSizer(wxVERTICAL);
- int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
+ int pane_borderSize = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE);
wxSize cli_size = m_frame->GetClientSize();
int i, dock_count, pane_count;
{
if (dock.panes.Item(j)->HasBorder())
{
- size += (pane_border_size*2);
+ size += (pane_borderSize*2);
break;
}
}
// new dock's size may not be more than the dock constraint
// parameter specifies. See SetDockSizeConstraint()
- int max_dock_x_size = (int)(m_dock_constraint_x * ((double)cli_size.x));
- int max_dock_y_size = (int)(m_dock_constraint_y * ((double)cli_size.y));
+ int max_dock_x_size = (int)(m_dockConstraintX * ((double)cli_size.x));
+ int max_dock_y_size = (int)(m_dockConstraintY * ((double)cli_size.y));
if (dock.IsHorizontal())
size = wxMin(size, max_dock_y_size);
}
if (plus_border)
- dock_min_size += (pane_border_size*2);
+ dock_min_size += (pane_borderSize*2);
if (plus_caption && dock.IsHorizontal())
dock_min_size += (caption_size);
for (row = 0,row_count = arr.GetCount(); row<row_count; ++row)
LayoutAddDock(middle, *arr.Item(row), uiparts, spacer_only);
}
- else if (!m_has_maximized)
+ else if (!m_hasMaximized)
{
// there are no center docks, add a background area
wxSizerItem* sizer_item = middle->Add(1,1, 1, wxEXPAND);
void wxAuiManager::SetDockSizeConstraint(double width_pct, double height_pct)
{
- m_dock_constraint_x = wxMax(0.0, wxMin(1.0, width_pct));
- m_dock_constraint_y = wxMax(0.0, wxMin(1.0, height_pct));
+ m_dockConstraintX = wxMax(0.0, wxMin(1.0, width_pct));
+ m_dockConstraintY = wxMax(0.0, wxMin(1.0, height_pct));
}
void wxAuiManager::GetDockSizeConstraint(double* width_pct, double* height_pct) const
{
if (width_pct)
- *width_pct = m_dock_constraint_x;
+ *width_pct = m_dockConstraintX;
if (height_pct)
- *height_pct = m_dock_constraint_y;
+ *height_pct = m_dockConstraintY;
}
void wxAuiManager::Update()
{
- m_hover_button = NULL;
- m_action_part = NULL;
+ m_hoverButton = NULL;
+ m_actionPart = NULL;
wxSizer* sizer;
int i, pane_count = m_panes.GetCount();
// also gets fired. Because we may be dragging around
// a pane, we need to cancel that action here to prevent
// a spurious crash.
- if (m_action_window == p.frame)
+ if (m_actionWindow == p.frame)
{
if (wxWindow::GetCapture() == m_frame)
m_frame->ReleaseMouse();
m_action = actionNone;
- m_action_window = NULL;
+ m_actionWindow = NULL;
}
// hide the frame
p.frame->Show(false);
// reparent to m_frame and destroy the pane
- if (m_action_window == p.frame)
+ if (m_actionWindow == p.frame)
{
- m_action_window = NULL;
+ m_actionWindow = NULL;
}
p.window->Reparent(m_frame);
m_frame->SetSizer(NULL);
// create a layout for all of the panes
- sizer = LayoutAll(m_panes, m_docks, m_uiparts, false);
+ sizer = LayoutAll(m_panes, m_docks, m_uiParts, false);
// hide or show panes as necessary,
// and float panes as necessary
m_frame->Layout();
int i, part_count;
- for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i)
+ for (i = 0, part_count = m_uiParts.GetCount(); i < part_count; ++i)
{
- wxAuiDockUIPart& part = m_uiparts.Item(i);
+ wxAuiDockUIPart& part = m_uiParts.Item(i);
// get the rectangle of the UI part
// originally, this code looked like this:
wxAuiDockUIPart* wxAuiManager::GetPanePart(wxWindow* wnd)
{
int i, part_count;
- for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i)
+ for (i = 0, part_count = m_uiParts.GetCount(); i < part_count; ++i)
{
- wxAuiDockUIPart& part = m_uiparts.Item(i);
+ wxAuiDockUIPart& part = m_uiParts.Item(i);
if (part.type == wxAuiDockUIPart::typePaneBorder &&
part.pane && part.pane->window == wnd)
return ∂
}
- for (i = 0, part_count = m_uiparts.GetCount(); i < part_count; ++i)
+ for (i = 0, part_count = m_uiParts.GetCount(); i < part_count; ++i)
{
- wxAuiDockUIPart& part = m_uiparts.Item(i);
+ wxAuiDockUIPart& part = m_uiParts.Item(i);
if (part.type == wxAuiDockUIPart::typePane &&
part.pane && part.pane->window == wnd)
return ∂
if (!part->dock->fixed || part->dock->dock_direction == wxAUI_DOCK_CENTER ||
pt.x >= cli_size.x || pt.x <= 0 || pt.y >= cli_size.y || pt.y <= 0)
{
- if (m_last_rect.IsEmpty() || m_last_rect.Contains(pt.x, pt.y ))
+ if (m_lastRect.IsEmpty() || m_lastRect.Contains(pt.x, pt.y ))
{
m_skipping = true;
}
m_skipping = false;
- m_last_rect = part->dock->rect;
- m_last_rect.Inflate( 15, 15 );
+ m_lastRect = part->dock->rect;
+ m_lastRect.Inflate( 15, 15 );
drop.Dock().
Direction(part->dock->dock_direction).
void wxAuiManager::OnHintFadeTimer(wxTimerEvent& WXUNUSED(event))
{
- if (!m_hint_wnd || m_hint_fadeamt >= m_hint_fademax)
+ if (!m_hintWnd || m_hintFadeAmt >= m_hintFadeMax)
{
- m_hint_fadetimer.Stop();
- Disconnect(m_hint_fadetimer.GetId(), wxEVT_TIMER,
+ m_hintFadeTimer.Stop();
+ Disconnect(m_hintFadeTimer.GetId(), wxEVT_TIMER,
wxTimerEventHandler(wxAuiManager::OnHintFadeTimer));
return;
}
- m_hint_fadeamt += 4;
- m_hint_wnd->SetTransparent(m_hint_fadeamt);
+ m_hintFadeAmt += 4;
+ m_hintWnd->SetTransparent(m_hintFadeAmt);
}
void wxAuiManager::ShowHint(const wxRect& rect)
{
- if (m_hint_wnd)
+ if (m_hintWnd)
{
// if the hint rect is the same as last time, don't do anything
- if (m_last_hint == rect)
+ if (m_lastHint == rect)
return;
- m_last_hint = rect;
+ m_lastHint = rect;
- m_hint_fadeamt = m_hint_fademax;
+ m_hintFadeAmt = m_hintFadeMax;
if ((m_flags & wxAUI_MGR_HINT_FADE)
- && !((m_hint_wnd->IsKindOf(CLASSINFO(wxPseudoTransparentFrame))) &&
+ && !((m_hintWnd->IsKindOf(CLASSINFO(wxPseudoTransparentFrame))) &&
(m_flags & wxAUI_MGR_NO_VENETIAN_BLINDS_FADE))
)
- m_hint_fadeamt = 0;
+ m_hintFadeAmt = 0;
- m_hint_wnd->SetSize(rect);
- m_hint_wnd->SetTransparent(m_hint_fadeamt);
+ m_hintWnd->SetSize(rect);
+ m_hintWnd->SetTransparent(m_hintFadeAmt);
- if (!m_hint_wnd->IsShown())
- m_hint_wnd->Show();
+ if (!m_hintWnd->IsShown())
+ m_hintWnd->Show();
// if we are dragging a floating pane, set the focus
// back to that floating pane (otherwise it becomes unfocused)
- if (m_action == actionDragFloatingPane && m_action_window)
- m_action_window->SetFocus();
+ if (m_action == actionDragFloatingPane && m_actionWindow)
+ m_actionWindow->SetFocus();
- m_hint_wnd->Raise();
+ m_hintWnd->Raise();
- if (m_hint_fadeamt != m_hint_fademax) // Only fade if we need to
+ if (m_hintFadeAmt != m_hintFadeMax) // Only fade if we need to
{
// start fade in timer
- m_hint_fadetimer.SetOwner(this);
- m_hint_fadetimer.Start(5);
- Connect(m_hint_fadetimer.GetId(), wxEVT_TIMER,
+ m_hintFadeTimer.SetOwner(this);
+ m_hintFadeTimer.Start(5);
+ Connect(m_hintFadeTimer.GetId(), wxEVT_TIMER,
wxTimerEventHandler(wxAuiManager::OnHintFadeTimer));
}
}
if (!(m_flags & wxAUI_MGR_RECTANGLE_HINT))
return;
- if (m_last_hint != rect)
+ if (m_lastHint != rect)
{
// remove the last hint rectangle
- m_last_hint = rect;
+ m_lastHint = rect;
m_frame->Refresh();
m_frame->Update();
}
void wxAuiManager::HideHint()
{
// hides a transparent window hint, if there is one
- if (m_hint_wnd)
+ if (m_hintWnd)
{
- if (m_hint_wnd->IsShown())
- m_hint_wnd->Show(false);
- m_hint_wnd->SetTransparent(0);
- m_hint_fadetimer.Stop();
+ if (m_hintWnd->IsShown())
+ m_hintWnd->Show(false);
+ m_hintWnd->SetTransparent(0);
+ m_hintFadeTimer.Stop();
// In case this is called while a hint fade is going, we need to
// disconnect the event handler.
- Disconnect(m_hint_fadetimer.GetId(), wxEVT_TIMER,
+ Disconnect(m_hintFadeTimer.GetId(), wxEVT_TIMER,
wxTimerEventHandler(wxAuiManager::OnHintFadeTimer));
- m_last_hint = wxRect();
+ m_lastHint = wxRect();
return;
}
// hides a painted hint by redrawing the frame window
- if (!m_last_hint.IsEmpty())
+ if (!m_lastHint.IsEmpty())
{
m_frame->Refresh();
m_frame->Update();
- m_last_hint = wxRect();
+ m_lastHint = wxRect();
}
}
m_action = actionDragFloatingPane;
}
- m_action_window = pane_window;
- m_action_offset = offset;
+ m_actionWindow = pane_window;
+ m_actionOffset = offset;
m_frame->CaptureMouse();
if (pane.frame)
wxRect client_rect = pane.frame->GetClientRect();
wxPoint client_pt = pane.frame->ClientToScreen(client_rect.GetTopLeft());
wxPoint origin_pt = client_pt - window_rect.GetTopLeft();
- m_action_offset += origin_pt;
+ m_actionOffset += origin_pt;
}
}
pane = hint;
m_action = actionDragToolbarPane;
- m_action_window = pane.window;
+ m_actionWindow = pane.window;
Update();
if (m_flags & wxAUI_MGR_TRANSPARENT_DRAG)
pane.frame->SetTransparent(255);
}
- else if (m_has_maximized)
+ else if (m_hasMaximized)
{
RestoreMaximizedPane();
}
dc->Clear() ;
#endif
int i, part_count;
- for (i = 0, part_count = m_uiparts.GetCount();
+ for (i = 0, part_count = m_uiParts.GetCount();
i < part_count; ++i)
{
- wxAuiDockUIPart& part = m_uiparts.Item(i);
+ wxAuiDockUIPart& part = m_uiParts.Item(i);
// don't draw hidden pane items or items that aren't windows
if (part.sizer_item && ((!part.sizer_item->IsWindow() && !part.sizer_item->IsSpacer() && !part.sizer_item->IsSizer()) || !part.sizer_item->IsShown()))
return;
m_action = actionResize;
- m_action_part = part;
- m_action_hintrect = wxRect();
- m_action_start = wxPoint(event.m_x, event.m_y);
- m_action_offset = wxPoint(event.m_x - part->rect.x,
+ m_actionPart = part;
+ m_actionHintRect = wxRect();
+ m_actionStart = wxPoint(event.m_x, event.m_y);
+ m_actionOffset = wxPoint(event.m_x - part->rect.x,
event.m_y - part->rect.y);
m_frame->CaptureMouse();
}
else if (part->type == wxAuiDockUIPart::typePaneButton)
{
m_action = actionClickButton;
- m_action_part = part;
- m_action_start = wxPoint(event.m_x, event.m_y);
+ m_actionPart = part;
+ m_actionStart = wxPoint(event.m_x, event.m_y);
m_frame->CaptureMouse();
UpdateButtonOnScreen(part, event);
return;
m_action = actionClickCaption;
- m_action_part = part;
- m_action_start = wxPoint(event.m_x, event.m_y);
- m_action_offset = wxPoint(event.m_x - part->rect.x,
+ m_actionPart = part;
+ m_actionStart = wxPoint(event.m_x, event.m_y);
+ m_actionOffset = wxPoint(event.m_x - part->rect.x,
event.m_y - part->rect.y);
m_frame->CaptureMouse();
}
bool wxAuiManager::DoEndResizeAction(wxMouseEvent& event)
{
// resize the dock or the pane
- if (m_action_part && m_action_part->type==wxAuiDockUIPart::typeDockSizer)
+ if (m_actionPart && m_actionPart->type==wxAuiDockUIPart::typeDockSizer)
{
// first, we must calculate the maximum size the dock may be
- int sash_size = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE);
+ int sashSize = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE);
int used_width = 0, used_height = 0;
used_width += dock.size;
}
if (dock.resizable)
- used_width += sash_size;
+ used_width += sashSize;
}
}
#endif
- wxRect& rect = m_action_part->dock->rect;
+ wxRect& rect = m_actionPart->dock->rect;
- wxPoint new_pos(event.m_x - m_action_offset.x,
- event.m_y - m_action_offset.y);
- int new_size, old_size = m_action_part->dock->size;
+ wxPoint new_pos(event.m_x - m_actionOffset.x,
+ event.m_y - m_actionOffset.y);
+ int new_size, old_size = m_actionPart->dock->size;
- switch (m_action_part->dock->dock_direction)
+ switch (m_actionPart->dock->dock_direction)
{
case wxAUI_DOCK_LEFT:
new_size = new_pos.x - rect.x;
if (new_size-old_size > available_width)
new_size = old_size+available_width;
- m_action_part->dock->size = new_size;
+ m_actionPart->dock->size = new_size;
break;
case wxAUI_DOCK_TOP:
new_size = new_pos.y - rect.y;
if (new_size-old_size > available_height)
new_size = old_size+available_height;
- m_action_part->dock->size = new_size;
+ m_actionPart->dock->size = new_size;
break;
case wxAUI_DOCK_RIGHT:
new_size = rect.x + rect.width - new_pos.x -
- m_action_part->rect.GetWidth();
+ m_actionPart->rect.GetWidth();
if (new_size-old_size > available_width)
new_size = old_size+available_width;
- m_action_part->dock->size = new_size;
+ m_actionPart->dock->size = new_size;
break;
case wxAUI_DOCK_BOTTOM:
new_size = rect.y + rect.height -
- new_pos.y - m_action_part->rect.GetHeight();
+ new_pos.y - m_actionPart->rect.GetHeight();
if (new_size-old_size > available_height)
new_size = old_size+available_height;
- m_action_part->dock->size = new_size;
+ m_actionPart->dock->size = new_size;
break;
}
Update();
Repaint(NULL);
}
- else if (m_action_part &&
- m_action_part->type == wxAuiDockUIPart::typePaneSizer)
+ else if (m_actionPart &&
+ m_actionPart->type == wxAuiDockUIPart::typePaneSizer)
{
- wxAuiDockInfo& dock = *m_action_part->dock;
- wxAuiPaneInfo& pane = *m_action_part->pane;
+ wxAuiDockInfo& dock = *m_actionPart->dock;
+ wxAuiPaneInfo& pane = *m_actionPart->pane;
int total_proportion = 0;
int dock_pixels = 0;
int new_pixsize = 0;
int caption_size = m_art->GetMetric(wxAUI_DOCKART_CAPTION_SIZE);
- int pane_border_size = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
- int sash_size = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE);
+ int pane_borderSize = m_art->GetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE);
+ int sashSize = m_art->GetMetric(wxAUI_DOCKART_SASH_SIZE);
- wxPoint new_pos(event.m_x - m_action_offset.x,
- event.m_y - m_action_offset.y);
+ wxPoint new_pos(event.m_x - m_actionOffset.x,
+ event.m_y - m_actionOffset.y);
// determine the pane rectangle by getting the pane part
wxAuiDockUIPart* pane_part = GetPanePart(pane.window);
// width from the dock width, because this would
// skew our proportion calculations
if (i > 0)
- dock_pixels -= sash_size;
+ dock_pixels -= sashSize;
// also, the whole size (including decorations) of
// all fixed panes must also be subtracted, because they
min_size = 0;
if (pane.HasBorder())
- min_size += (pane_border_size*2);
+ min_size += (pane_borderSize*2);
// calculate minimum size with decorations (border,caption)
if (pane_part->orientation == wxVERTICAL)
{
// get rid of the hint rectangle
wxScreenDC dc;
- DrawResizeHint(dc, m_action_hintrect);
+ DrawResizeHint(dc, m_actionHintRect);
}
if (m_currentDragItem != -1 && wxAuiManager_HasLiveResize(*this))
- m_action_part = & (m_uiparts.Item(m_currentDragItem));
+ m_actionPart = & (m_uiParts.Item(m_currentDragItem));
DoEndResizeAction(event);
}
else if (m_action == actionClickButton)
{
- m_hover_button = NULL;
+ m_hoverButton = NULL;
m_frame->ReleaseMouse();
- if (m_action_part)
+ if (m_actionPart)
{
- UpdateButtonOnScreen(m_action_part, event);
+ UpdateButtonOnScreen(m_actionPart, event);
// make sure we're still over the item that was originally clicked
- if (m_action_part == HitTest(event.GetX(), event.GetY()))
+ if (m_actionPart == HitTest(event.GetX(), event.GetY()))
{
// fire button-click event
wxAuiManagerEvent e(wxEVT_AUI_PANE_BUTTON);
e.SetManager(this);
- e.SetPane(m_action_part->pane);
- e.SetButton(m_action_part->button->button_id);
+ e.SetPane(m_actionPart->pane);
+ e.SetButton(m_actionPart->button->button_id);
ProcessMgrEvent(e);
}
}
{
m_frame->ReleaseMouse();
- wxAuiPaneInfo& pane = GetPane(m_action_window);
+ wxAuiPaneInfo& pane = GetPane(m_actionWindow);
wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found"));
// save the new positions
}
m_action = actionNone;
- m_last_mouse_move = wxPoint(); // see comment in OnMotion()
+ m_lastMouseMove = wxPoint(); // see comment in OnMotion()
}
// mouse move event is being generated. only verified on MSW
wxPoint mouse_pos = event.GetPosition();
- if (m_last_mouse_move == mouse_pos)
+ if (m_lastMouseMove == mouse_pos)
return;
- m_last_mouse_move = mouse_pos;
+ m_lastMouseMove = mouse_pos;
if (m_action == actionResize)
{
- // It's necessary to reset m_action_part since it destroyed
+ // It's necessary to reset m_actionPart since it destroyed
// by the Update within DoEndResizeAction.
if (m_currentDragItem != -1)
- m_action_part = & (m_uiparts.Item(m_currentDragItem));
+ m_actionPart = & (m_uiParts.Item(m_currentDragItem));
else
- m_currentDragItem = m_uiparts.Index(* m_action_part);
+ m_currentDragItem = m_uiParts.Index(* m_actionPart);
- if (m_action_part)
+ if (m_actionPart)
{
- wxPoint pos = m_action_part->rect.GetPosition();
- if (m_action_part->orientation == wxHORIZONTAL)
- pos.y = wxMax(0, event.m_y - m_action_offset.y);
+ wxPoint pos = m_actionPart->rect.GetPosition();
+ if (m_actionPart->orientation == wxHORIZONTAL)
+ pos.y = wxMax(0, event.m_y - m_actionOffset.y);
else
- pos.x = wxMax(0, event.m_x - m_action_offset.x);
+ pos.x = wxMax(0, event.m_x - m_actionOffset.x);
if (wxAuiManager_HasLiveResize(*this))
{
else
{
wxRect rect(m_frame->ClientToScreen(pos),
- m_action_part->rect.GetSize());
+ m_actionPart->rect.GetSize());
wxScreenDC dc;
- if (!m_action_hintrect.IsEmpty())
+ if (!m_actionHintRect.IsEmpty())
{
// remove old resize hint
- DrawResizeHint(dc, m_action_hintrect);
- m_action_hintrect = wxRect();
+ DrawResizeHint(dc, m_actionHintRect);
+ m_actionHintRect = wxRect();
}
// draw new resize hint, if it's inside the managed frame
- wxRect frame_screen_rect = m_frame->GetScreenRect();
- if (frame_screen_rect.Contains(rect))
+ wxRect frameScreenRect = m_frame->GetScreenRect();
+ if (frameScreenRect.Contains(rect))
{
DrawResizeHint(dc, rect);
- m_action_hintrect = rect;
+ m_actionHintRect = rect;
}
}
}
// caption has been clicked. we need to check if the mouse
// is now being dragged. if it is, we need to change the
// mouse action to 'drag'
- if (m_action_part &&
- (abs(event.m_x - m_action_start.x) > drag_x_threshold ||
- abs(event.m_y - m_action_start.y) > drag_y_threshold))
+ if (m_actionPart &&
+ (abs(event.m_x - m_actionStart.x) > drag_x_threshold ||
+ abs(event.m_y - m_actionStart.y) > drag_y_threshold))
{
- wxAuiPaneInfo* pane_info = m_action_part->pane;
+ wxAuiPaneInfo* paneInfo = m_actionPart->pane;
- if (!pane_info->IsToolbar())
+ if (!paneInfo->IsToolbar())
{
if ((m_flags & wxAUI_MGR_ALLOW_FLOATING) &&
- pane_info->IsFloatable())
+ paneInfo->IsFloatable())
{
m_action = actionDragFloatingPane;
// set initial float position
wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
- pane_info->floating_pos = wxPoint(pt.x - m_action_offset.x,
- pt.y - m_action_offset.y);
+ paneInfo->floating_pos = wxPoint(pt.x - m_actionOffset.x,
+ pt.y - m_actionOffset.y);
// float the window
- if (pane_info->IsMaximized())
- RestorePane(*pane_info);
- pane_info->Float();
+ if (paneInfo->IsMaximized())
+ RestorePane(*paneInfo);
+ paneInfo->Float();
Update();
- m_action_window = pane_info->frame;
+ m_actionWindow = paneInfo->frame;
// action offset is used here to make it feel "natural" to the user
// to drag a docked pane and suddenly have it become a floating frame.
// Sometimes, however, the offset where the user clicked on the docked
// caption is bigger than the width of the floating frame itself, so
// in that case we need to set the action offset to a sensible value
- wxSize frame_size = m_action_window->GetSize();
- if (frame_size.x <= m_action_offset.x)
- m_action_offset.x = 30;
+ wxSize frame_size = m_actionWindow->GetSize();
+ if (frame_size.x <= m_actionOffset.x)
+ m_actionOffset.x = 30;
}
}
else
{
m_action = actionDragToolbarPane;
- m_action_window = pane_info->window;
+ m_actionWindow = paneInfo->window;
}
}
}
else if (m_action == actionDragFloatingPane)
{
- if (m_action_window)
+ if (m_actionWindow)
{
// We can't move the child window so we need to get the frame that
// we want to be really moving. This is probably not the best place
// to do this but at least it fixes the bug (#13177) for now.
- if (!m_action_window->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
+ if (!m_actionWindow->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
{
- wxAuiPaneInfo& pane = GetPane(m_action_window);
- m_action_window = pane.frame;
+ wxAuiPaneInfo& pane = GetPane(m_actionWindow);
+ m_actionWindow = pane.frame;
}
wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
- m_action_window->Move(pt.x - m_action_offset.x,
- pt.y - m_action_offset.y);
+ m_actionWindow->Move(pt.x - m_actionOffset.x,
+ pt.y - m_actionOffset.y);
}
}
else if (m_action == actionDragToolbarPane)
{
- wxAuiPaneInfo& pane = GetPane(m_action_window);
+ wxAuiPaneInfo& pane = GetPane(m_actionWindow);
wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found"));
pane.SetFlag(wxAuiPaneInfo::actionPane, true);
wxPoint pt = event.GetPosition();
- DoDrop(m_docks, m_panes, pane, pt, m_action_offset);
+ DoDrop(m_docks, m_panes, pane, pt, m_actionOffset);
// if DoDrop() decided to float the pane, set up
// the floating pane's initial position
if (pane.IsFloating())
{
wxPoint pt = m_frame->ClientToScreen(event.GetPosition());
- pane.floating_pos = wxPoint(pt.x - m_action_offset.x,
- pt.y - m_action_offset.y);
+ pane.floating_pos = wxPoint(pt.x - m_actionOffset.x,
+ pt.y - m_actionOffset.y);
}
// this will do the actiual move operation;
{
pane.state &= ~wxAuiPaneInfo::actionPane;
m_action = actionDragFloatingPane;
- m_action_window = pane.frame;
+ m_actionWindow = pane.frame;
}
}
else
wxAuiDockUIPart* part = HitTest(event.GetX(), event.GetY());
if (part && part->type == wxAuiDockUIPart::typePaneButton)
{
- if (part != m_hover_button)
+ if (part != m_hoverButton)
{
// make the old button normal
- if (m_hover_button)
+ if (m_hoverButton)
{
- UpdateButtonOnScreen(m_hover_button, event);
+ UpdateButtonOnScreen(m_hoverButton, event);
Repaint();
}
// mouse is over a button, so repaint the
// button in hover mode
UpdateButtonOnScreen(part, event);
- m_hover_button = part;
+ m_hoverButton = part;
}
}
else
{
- if (m_hover_button)
+ if (m_hoverButton)
{
- m_hover_button = NULL;
+ m_hoverButton = NULL;
Repaint();
}
else
void wxAuiManager::OnLeaveWindow(wxMouseEvent& WXUNUSED(event))
{
- if (m_hover_button)
+ if (m_hoverButton)
{
- m_hover_button = NULL;
+ m_hoverButton = NULL;
Repaint();
}
}
// is, but those are the expected symantics. No style flag is passed
// onto the panel underneath.
if (style & wxMINIMIZE)
- m_activate_on_create = false;
+ m_activateOnCreate = false;
Create(parent, id, title, wxDefaultPosition, size, 0, name);
}
// see comment in constructor
if (style & wxMINIMIZE)
- m_activate_on_create = false;
+ m_activateOnCreate = false;
wxSize cli_size = pClientWindow->GetClientSize();
m_title = title;
- pClientWindow->AddPage(this, title, m_activate_on_create);
+ pClientWindow->AddPage(this, title, m_activateOnCreate);
pClientWindow->Refresh();
return true;
{
// get icon with the system icon size
SetIcon(icons.GetIcon(-1));
- m_icon_bundle = icons;
+ m_iconBundle = icons;
}
const wxIconBundle& wxAuiMDIChildFrame::GetIcons() const
{
- return m_icon_bundle;
+ return m_iconBundle;
}
void wxAuiMDIChildFrame::SetIcon(const wxIcon& icon)
void wxAuiMDIChildFrame::Init()
{
- m_activate_on_create = true;
+ m_activateOnCreate = true;
m_pMDIParentFrame = NULL;
#if wxUSE_MENUS
m_pMenuBar = NULL;
bool wxAuiMDIChildFrame::Show(bool show)
{
- m_activate_on_create = show;
+ m_activateOnCreate = show;
// do nothing
return true;
void wxAuiMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
- m_mdi_newrect = wxRect(x, y, width, height);
+ m_mdiNewRect = wxRect(x, y, width, height);
#ifdef __WXGTK__
wxPanel::DoSetSize(x,y,width, height, sizeFlags);
#else
void wxAuiMDIChildFrame::DoMoveWindow(int x, int y, int width, int height)
{
- m_mdi_newrect = wxRect(x, y, width, height);
+ m_mdiNewRect = wxRect(x, y, width, height);
}
void wxAuiMDIChildFrame::ApplyMDIChildFrameRect()
{
- if (m_mdi_currect != m_mdi_newrect)
+ if (m_mdiCurRect != m_mdiNewRect)
{
- wxPanel::DoMoveWindow(m_mdi_newrect.x, m_mdi_newrect.y,
- m_mdi_newrect.width, m_mdi_newrect.height);
- m_mdi_currect = m_mdi_newrect;
+ wxPanel::DoMoveWindow(m_mdiNewRect.x, m_mdiNewRect.y,
+ m_mdiNewRect.width, m_mdiNewRect.height);
+ m_mdiCurRect = m_mdiNewRect;
}
}