- Added wxCommandLinkButton (Rickard Westerlund, GSoC 2010 project).
- Added wxUIActionSimulator (Steven Lamerton, GSoC 2010 project).
- wxAUI: support auto-orientable toolbars (wsu).
+- wxAUI: add support for icons in pane title bars (triton).
- Added wxDataViewCtrl::Set/GetCurrentItem().
- Added possibility to disable individual wxDataViewCtrl items (Neno Ganchev).
- wxHTML: render in RTL order inside RTL window (Richard Bullington-McGuire).
const wxRect& rect,
wxAuiPaneInfo& pane);
+ void DrawIcon(wxDC& dc,
+ const wxRect& rect,
+ wxAuiPaneInfo& pane);
+
protected:
void DrawCaptionBackground(wxDC& dc, const wxRect& rect, bool active);
{
name = c.name;
caption = c.caption;
+ icon = c.icon;
window = c.window;
frame = c.frame;
state = c.state;
}
wxAuiPaneInfo& Name(const wxString& n) { name = n; return *this; }
wxAuiPaneInfo& Caption(const wxString& c) { caption = c; return *this; }
+ wxAuiPaneInfo& Icon(const wxBitmap& b) { icon = b; return *this; }
wxAuiPaneInfo& Left() { dock_direction = wxAUI_DOCK_LEFT; return *this; }
wxAuiPaneInfo& Right() { dock_direction = wxAUI_DOCK_RIGHT; return *this; }
wxAuiPaneInfo& Top() { dock_direction = wxAUI_DOCK_TOP; return *this; }
public:
wxString name; // name of the pane
wxString caption; // caption displayed on the window
+ wxBitmap icon; // icon of the pane, may be invalid
wxWindow* window; // window that is in this pane
wxFrame* frame; // floating frame window that holds the pane
wxAuiPaneButtonArray buttons; // buttons on the pane
+
wxRect rect; // current rectangle (populated by wxAUI)
bool IsValid() const;
*/
wxAuiPaneInfo& Hide();
+ /**
+ Icon() sets the icon of the pane.
+
+ Notice that the height of the icon should be smaller than the value
+ returned by wxAuiDockArt::GetMetric(wxAUI_DOCKART_CAPTION_SIZE) to
+ ensure that it appears correctly.
+
+ @since 2.9.2
+ */
+ wxAuiPaneInfo& Icon(const wxBitmap& b);
+
/**
IsBottomDockable() returns @true if the pane can be docked at the bottom of the
managed frame.
CloseButton(true).MaximizeButton(true));
wxWindow* wnd10 = CreateTextCtrl(wxT("This pane will prompt the user before hiding."));
+
+ // Give this pane an icon, too, just for testing.
+ int iconSize = m_mgr.GetArtProvider()->GetMetric(wxAUI_DOCKART_CAPTION_SIZE);
+
+ // Make it even to use 16 pixel icons with default 17 caption height.
+ iconSize &= ~1;
+
m_mgr.AddPane(wnd10, wxAuiPaneInfo().
Name(wxT("test10")).Caption(wxT("Text Pane with Hide Prompt")).
- Bottom().Layer(1).Position(1));
+ Bottom().Layer(1).Position(1).
+ Icon(wxArtProvider::GetBitmap(wxART_WARNING,
+ wxART_OTHER,
+ wxSize(iconSize, iconSize))));
m_mgr.AddPane(CreateSizeReportCtrl(), wxAuiPaneInfo().
Name(wxT("test11")).Caption(wxT("Fixed Pane")).
DrawCaptionBackground(dc, rect,
(pane.state & wxAuiPaneInfo::optionActive)?true:false);
+ int caption_offset = 0;
+ if ( pane.icon.IsOk() )
+ {
+ DrawIcon(dc, rect, pane);
+
+ caption_offset += pane.icon.GetWidth() + 3;
+ }
+
if (pane.state & wxAuiPaneInfo::optionActive)
dc.SetTextForeground(m_active_caption_text_colour);
else
wxString draw_text = wxAuiChopText(dc, text, clip_rect.width);
dc.SetClippingRegion(clip_rect);
- dc.DrawText(draw_text, rect.x+3, rect.y+(rect.height/2)-(h/2)-1);
+ dc.DrawText(draw_text, rect.x+3 + caption_offset, rect.y+(rect.height/2)-(h/2)-1);
dc.DestroyClippingRegion();
}
+void
+wxAuiDefaultDockArt::DrawIcon(wxDC& dc, const wxRect& rect, wxAuiPaneInfo& pane)
+{
+ // Draw the icon centered vertically
+ dc.DrawBitmap(pane.icon,
+ rect.x+2, rect.y+(rect.height-pane.icon.GetHeight())/2,
+ true);
+}
+
void wxAuiDefaultDockArt::DrawGripper(wxDC& dc, wxWindow *WXUNUSED(window),
const wxRect& rect,
wxAuiPaneInfo& pane)