本文整理汇总了C++中wxAuiNotebookPageArray::GetCount方法的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiNotebookPageArray::GetCount方法的具体用法?C++ wxAuiNotebookPageArray::GetCount怎么用?C++ wxAuiNotebookPageArray::GetCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxAuiNotebookPageArray
的用法示例。
在下文中一共展示了wxAuiNotebookPageArray::GetCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBestTabCtrlSize
int clAuiSimpleTabArt::GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
const wxSize& required_bmp_size)
{
wxClientDC dc(wnd);
dc.SetFont(m_measuring_font);
int x_ext = 0;
// 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 bmp;
if (pages.GetCount() && pages.Item(0).bitmap.IsOk()) {
bmp = pages.Item(0).bitmap;
}
wxSize s = GetTabSize(dc,
wnd,
wxT("ABCDEFGHIj"),
bmp.IsOk() ? bmp : wxNullBitmap,
true,
wxAUI_BUTTON_STATE_HIDDEN,
&x_ext);
return s.y+3;
}
示例2: GetBestTabCtrlSize
int wxAuiGenericTabArt::GetBestTabCtrlSize(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
const wxSize& requiredBmp_size)
{
wxClientDC dc(wnd);
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 measureBmp;
if (requiredBmp_size.IsFullySpecified())
{
measureBmp.Create(requiredBmp_size.x,
requiredBmp_size.y);
}
int max_y = 0;
size_t i, page_count = pages.GetCount();
for (i = 0; i < page_count; ++i)
{
wxAuiNotebookPage& page = pages.Item(i);
wxBitmap bmp;
if (measureBmp.IsOk())
bmp = measureBmp;
else
bmp = page.bitmap;
// we don't use the caption text because we don't
// want tab heights to be different in the case
// of a very short piece of text on one tab and a very
// tall piece of text on another tab
int x_ext = 0;
wxSize s = GetTabSize(dc,
wnd,
wxT("ABCDEFGHIj"),
bmp,
true,
wxAUI_BUTTON_STATE_HIDDEN,
&x_ext);
max_y = wxMax(max_y, s.y);
}
return max_y+2;
}
示例3: wxT
int gd::FlatAuiTabArt::ShowDropDown(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
int active_idx)
{
wxMenu menuPopup;
size_t i, count = pages.GetCount();
for (i = 0; i < count; ++i)
{
const wxAuiNotebookPage& page = pages.Item(i);
wxString caption = page.caption;
// if there is no caption, make it a space. This will prevent
// an assert in the menu code.
if (caption.IsEmpty())
caption = wxT(" ");
menuPopup.AppendCheckItem(1000+i, caption);
}
if (active_idx != -1)
{
menuPopup.Check(1000+active_idx, true);
}
// find out where to put the popup menu of window items
wxPoint pt = ::wxGetMousePosition();
pt = wnd->ScreenToClient(pt);
// find out the screen coordinate at the bottom of the tab ctrl
wxRect cli_rect = wnd->GetClientRect();
pt.y = cli_rect.y + cli_rect.height;
GDAuiCommandCapture* cc = new GDAuiCommandCapture;
wnd->PushEventHandler(cc);
wnd->PopupMenu(&menuPopup, pt);
int command = cc->GetCommandId();
wnd->PopEventHandler(true);
if (command >= 1000)
return command-1000;
return -1;
}
示例4: ShowDropDown
int wxAuiSimpleTabArt::ShowDropDown(wxWindow* wnd,
const wxAuiNotebookPageArray& pages,
int active_idx)
{
wxMenu menuPopup;
size_t i, count = pages.GetCount();
for (i = 0; i < count; ++i)
{
const wxAuiNotebookPage& page = pages.Item(i);
menuPopup.AppendCheckItem(1000+i, page.caption);
}
if (active_idx != -1)
{
menuPopup.Check(1000+active_idx, true);
}
// find out where to put the popup menu of window
// items. Subtract 100 for now to center the menu
// a bit, until a better mechanism can be implemented
wxPoint pt = ::wxGetMousePosition();
pt = wnd->ScreenToClient(pt);
if (pt.x < 100)
pt.x = 0;
else
pt.x -= 100;
// find out the screen coordinate at the bottom of the tab ctrl
wxRect cli_rect = wnd->GetClientRect();
pt.y = cli_rect.y + cli_rect.height;
wxAuiCommandCapture* cc = new wxAuiCommandCapture;
wnd->PushEventHandler(cc);
wnd->PopupMenu(&menuPopup, pt);
int command = cc->GetCommandId();
wnd->PopEventHandler(true);
if (command >= 1000)
return command-1000;
return -1;
}