本文整理汇总了C++中wxAuiNotebookPageArray类的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiNotebookPageArray类的具体用法?C++ wxAuiNotebookPageArray怎么用?C++ wxAuiNotebookPageArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxAuiNotebookPageArray类的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;
}
开发者ID:DemolisherOfSouls,项目名称:SLADE,代码行数:25,代码来源:cl_aui_notebook_art.cpp
示例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;
}
开发者ID:futurepr0n,项目名称:wxWidgets,代码行数:48,代码来源:tabart.cpp
示例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;
}
开发者ID:cubemoon,项目名称:GD,代码行数:44,代码来源:FlatAuiTabArt.cpp
示例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;
}
开发者ID:futurepr0n,项目名称:wxWidgets,代码行数:43,代码来源:tabart.cpp
注:本文中的wxAuiNotebookPageArray类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论