本文整理汇总了C++中wxWindowList类的典型用法代码示例。如果您正苦于以下问题:C++ wxWindowList类的具体用法?C++ wxWindowList怎么用?C++ wxWindowList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxWindowList类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoMustScroll
bool wxStandardDialogLayoutAdapter::DoFitWithScrolling(wxDialog* dialog, wxWindowList& windows)
{
wxSizer* sizer = dialog->GetSizer();
if (!sizer)
return false;
sizer->SetSizeHints(dialog);
wxSize windowSize, displaySize;
int scrollFlags = DoMustScroll(dialog, windowSize, displaySize);
int scrollBarSize = 20;
if (scrollFlags)
{
int scrollBarExtraX = 0, scrollBarExtraY = 0;
bool resizeHorizontally = (scrollFlags & wxHORIZONTAL) != 0;
bool resizeVertically = (scrollFlags & wxVERTICAL) != 0;
if (windows.GetCount() != 0)
{
// Allow extra for a scrollbar, assuming we resizing in one direction only.
if ((resizeVertically && !resizeHorizontally) && (windowSize.x < (displaySize.x - scrollBarSize)))
scrollBarExtraX = scrollBarSize;
if ((resizeHorizontally && !resizeVertically) && (windowSize.y < (displaySize.y - scrollBarSize)))
scrollBarExtraY = scrollBarSize;
}
wxWindowList::compatibility_iterator node = windows.GetFirst();
while (node)
{
wxWindow *win = node->GetData();
wxScrolledWindow* scrolledWindow = wxDynamicCast(win, wxScrolledWindow);
if (scrolledWindow)
{
scrolledWindow->SetScrollRate(resizeHorizontally ? 10 : 0, resizeVertically ? 10 : 0);
if (scrolledWindow->GetSizer())
scrolledWindow->GetSizer()->Fit(scrolledWindow);
}
node = node->GetNext();
}
wxSize limitTo = windowSize + wxSize(scrollBarExtraX, scrollBarExtraY);
if (resizeVertically)
limitTo.y = displaySize.y - wxEXTRA_DIALOG_HEIGHT;
if (resizeHorizontally)
limitTo.x = displaySize.x;
dialog->SetMinSize(limitTo);
dialog->SetSize(limitTo);
dialog->SetSizeHints( limitTo.x, limitTo.y, dialog->GetMaxWidth(), dialog->GetMaxHeight() );
}
return true;
}
示例2: ShowWindowRecursively
void ShowWindowRecursively(wxWindowList& hiddenWindows)
{
for(wxWindowList::iterator itr = hiddenWindows.begin(); itr != hiddenWindows.end(); ++itr) {
wxWindow* win = (*itr);
//Show is virtual, and dialog windows assume the window is just starting up when Show()
//is called. Make sure to call the base version
win->wxWindow::Show(true);
win->Raise();
win->Update();
}
hiddenWindows.clear();
}
示例3: findWindowRecursively
static bool findWindowRecursively( const wxWindowList& children, const wxWindow* wanted )
{
for( wxWindowList::const_iterator it = children.begin(); it != children.end(); ++it )
{
const wxWindow* child = *it;
if( wanted == child )
return true;
else
{
if( findWindowRecursively( child->GetChildren(), wanted ) )
return true;
}
}
return false;
}
示例4: OnCloseAll
void MDIWindowMenuEvtHandler::OnCloseAll(wxCommandEvent&)
{
const wxWindowList list = m_target_wnd->GetChildren(); // make a copy of the window list
for (wxWindowList::const_iterator i = list.begin();
i != list.end();
i++)
{
if (wxDynamicCast(*i, wxMDIChildFrame))
{
if (!(*i)->Close())
{
// Close was vetoed
break;
}
}
}
}
示例5: HideWindowRecursively
void HideWindowRecursively(wxTopLevelWindow* win, wxWindowList& hiddenWindows)
{
if (!win)
return;
wxWindowList& children = win->GetChildren();
for(wxWindowList::iterator itr = children.begin(); itr != children.end(); ++itr) {
if ((*itr)->IsTopLevel() && (*itr)->IsShown()) {
HideWindowRecursively(wxDynamicCast(*itr, wxTopLevelWindow), hiddenWindows);
}
}
//Don't call Hide() here, which just calls Show(false), which is overridden in
//derived classes, and wxDialog actually cancels the modal loop and closes the window
win->wxWindow::Show(false);
//push_front ensures we Show() in the reverse order of Hide()'ing
hiddenWindows.push_front(win);
}
示例6: Create
bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
SetName(name);
if ( id == wxID_ANY )
m_windowId = (int)NewControlId();
else
m_windowId = id;
if (parent)
parent->AddChild(this);
MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
wxModelessWindows.Append(this);
return true;
}
示例7: CreateClient
bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
{
if ( !wxWindow::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style) )
return false;
wxModelessWindows.Append(this);
return true;
}
示例8: wxMacDeferredWindowDeleter
wxTopLevelWindowMac::~wxTopLevelWindowMac()
{
if ( m_macWindow )
{
wxToolTip::NotifyWindowDelete(m_macWindow) ;
wxPendingDelete.Append( new wxMacDeferredWindowDeleter( (WindowRef) m_macWindow ) ) ;
}
#if TARGET_CARBON
if ( m_macEventHandler )
{
::RemoveEventHandler((EventHandlerRef) m_macEventHandler);
m_macEventHandler = NULL ;
}
#endif
wxRemoveMacWindowAssociation( this ) ;
if ( wxModelessWindows.Find(this) )
wxModelessWindows.DeleteObject(this);
DisposeRgn( (RgnHandle) m_macNoEraseUpdateRgn ) ;
}
示例9: Create
bool wxFrame::Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name)
{
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
return false;
wxModelessWindows.Append(this);
return true;
}