indentation cleanup, unused variables, constant expressions, etc

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47122 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2007-07-04 20:54:36 +00:00
parent cde76cf2a9
commit cedd7b22f4
7 changed files with 175 additions and 191 deletions

View File

@@ -225,7 +225,7 @@ public:
*this = source;
}
bool IsOk() const { return (window != NULL) ? true : false; }
bool IsOk() const { return window != NULL; }
bool IsFixed() const { return !HasFlag(optionResizable); }
bool IsResizable() const { return HasFlag(optionResizable); }
bool IsShown() const { return !HasFlag(optionHidden); }
@@ -341,7 +341,7 @@ public:
bool HasFlag(unsigned int flag) const
{
return (state & flag) ? true:false;
return (state & flag) != 0;
}
#ifdef SWIG
@@ -739,12 +739,12 @@ public:
}
#endif // SWIG
bool IsOk() const { return (dock_direction != 0) ? true : false; }
bool IsHorizontal() const { return (dock_direction == wxAUI_DOCK_TOP ||
dock_direction == wxAUI_DOCK_BOTTOM) ? true:false; }
bool IsVertical() const { return (dock_direction == wxAUI_DOCK_LEFT ||
bool IsOk() const { return dock_direction != 0; }
bool IsHorizontal() const { return dock_direction == wxAUI_DOCK_TOP ||
dock_direction == wxAUI_DOCK_BOTTOM; }
bool IsVertical() const { return dock_direction == wxAUI_DOCK_LEFT ||
dock_direction == wxAUI_DOCK_RIGHT ||
dock_direction == wxAUI_DOCK_CENTER) ? true:false; }
dock_direction == wxAUI_DOCK_CENTER; }
public:
wxAuiPaneInfoPtrArray panes; // array of panes
wxRect rect; // current rectangle

View File

@@ -154,6 +154,8 @@ public:
virtual void Activate();
virtual bool Destroy();
virtual bool Show(bool show = true);
#if wxUSE_STATUSBAR
// no status bars
virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1,
@@ -204,7 +206,6 @@ public:
protected:
void Init();
virtual bool Show(bool show = true);
virtual void DoSetSize(int x, int y, int width, int height, int size_flags);
virtual void DoMoveWindow(int x, int y, int width, int height);

View File

@@ -317,7 +317,7 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
{
wxCoord normal_textx, normal_texty;
wxCoord selected_textx, selected_texty;
wxCoord textx, texty;
wxCoord texty;
// if the caption is empty, measure some temporary text
wxString caption = page.caption;
@@ -353,13 +353,11 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
if (page.active)
{
dc.SetFont(m_selected_font);
textx = selected_textx;
texty = selected_texty;
}
else
{
dc.SetFont(m_normal_font);
textx = normal_textx;
texty = normal_texty;
}
@@ -474,7 +472,6 @@ void wxAuiDefaultTabArt::DrawTab(wxDC& dc,
// this gets rid of the top one of those lines in the tab control
if (page.active)
{
wxColor start_color = m_base_colour;
dc.SetPen(m_base_colour_pen);
dc.DrawLine(border_points[0].x+1,
border_points[0].y,
@@ -1754,11 +1751,9 @@ void wxAuiTabContainer::Render(wxDC* raw_dc, wxWindow* wnd)
wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(i);
// determine if a close button is on this tab
bool close_button = false;
if ((m_flags & wxAUI_NB_CLOSE_ON_ALL_TABS) != 0 ||
((m_flags & wxAUI_NB_CLOSE_ON_ACTIVE_TAB) != 0 && page.active))
{
close_button = true;
if (tab_button.cur_state == wxAUI_BUTTON_STATE_HIDDEN)
{
tab_button.id = wxAUI_BUTTON_CLOSE;
@@ -1811,14 +1806,6 @@ void wxAuiTabContainer::Render(wxDC* raw_dc, wxWindow* wnd)
wxAuiTabContainerButton& tab_button = m_tab_close_buttons.Item(active);
// determine if a close button is on this tab
bool close_button = false;
if ((m_flags & wxAUI_NB_CLOSE_ON_ALL_TABS) != 0 ||
((m_flags & wxAUI_NB_CLOSE_ON_ACTIVE_TAB) != 0 && page.active))
{
close_button = true;
}
rect.x = active_offset;
m_art->DrawTab(dc,
wnd,
@@ -2307,6 +2294,7 @@ public:
m_tab_ctrl_height = h;
}
protected:
void DoSetSize(int x, int y,
int width, int height,
int WXUNUSED(sizeFlags = wxSIZE_AUTO))
@@ -2321,6 +2309,7 @@ public:
*y = m_rect.height;
}
public:
bool Show( bool WXUNUSED(show = true) ) { return false; }
void DoSizing()
@@ -2351,6 +2340,7 @@ public:
}
}
protected:
void DoGetSize(int* x, int* y) const
{
if (x)
@@ -2359,13 +2349,12 @@ public:
*y = m_rect.GetHeight();
}
public:
void Update()
{
// does nothing
}
public:
wxRect m_rect;
wxRect m_tab_rect;
wxAuiTabCtrl* m_tabs;

View File

@@ -220,7 +220,7 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt()
wxColor darker1_colour = wxAuiStepColour(base_colour, 85);
wxColor darker2_colour = wxAuiStepColour(base_colour, 75);
wxColor darker3_colour = wxAuiStepColour(base_colour, 60);
wxColor darker4_colour = wxAuiStepColour(base_colour, 50);
//wxColor darker4_colour = wxAuiStepColour(base_colour, 50);
wxColor darker5_colour = wxAuiStepColour(base_colour, 40);
m_active_caption_colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT);
@@ -256,7 +256,7 @@ wxAuiDefaultDockArt::wxAuiDefaultDockArt()
0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFE, 0x03, 0xF8, 0x01, 0xF0, 0x19, 0xF3,
0xB8, 0xE3, 0xF0, 0xE1, 0xE0, 0xE0, 0xF0, 0xE1, 0xB8, 0xE3, 0x19, 0xF3,
0x01, 0xF0, 0x03, 0xF8, 0x0F, 0xFE, 0xFF, 0xFF };
#elif defined( __WXGTK__)
#elif defined(__WXGTK__)
static unsigned char close_bits[]={
0xff, 0xff, 0xff, 0xff, 0x07, 0xf0, 0xfb, 0xef, 0xdb, 0xed, 0x8b, 0xe8,
0x1b, 0xec, 0x3b, 0xee, 0x1b, 0xec, 0x8b, 0xe8, 0xdb, 0xed, 0xfb, 0xef,
@@ -444,6 +444,7 @@ void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation,
dc.SetBrush(m_sash_brush);
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
#if 0
GdkRectangle gdk_rect;
if (orientation == wxVERTICAL )
{
@@ -459,6 +460,7 @@ void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation,
gdk_rect.width = rect.width;
gdk_rect.height = m_sash_size;
}
#endif
if (!window) return;
if (!window->m_wxwindow) return;

View File

@@ -152,7 +152,7 @@ public:
wxRect rect(upd.GetRect());
dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height);
upd++;
++upd;
}
}
@@ -2774,16 +2774,11 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
return ProcessDockResult(target, drop);
}
else
{
m_skipping = false;
}
if (!m_skipping)
{
m_skipping = false;
m_last_rect = part->dock->rect;
m_last_rect.Inflate( 15, 15 );
}
drop.Dock().
Direction(part->dock->dock_direction).
@@ -3370,8 +3365,6 @@ void wxAuiManager::OnFloatingPaneMoving(wxWindow* wnd, wxDirection dir)
// no hint for toolbar floating windows
if (pane.IsToolbar() && m_action == actionDragFloatingPane)
{
if (m_action == actionDragFloatingPane)
{
wxAuiDockInfoArray docks;
wxAuiPaneInfoArray panes;
@@ -3391,7 +3384,6 @@ void wxAuiManager::OnFloatingPaneMoving(wxWindow* wnd, wxDirection dir)
m_action_window = pane.window;
Update();
}
return;
}