void Window_cancel_children( Handle self) { protect_object( self); if ( my-> get_modalHorizon( self)) { Handle next = var-> nextSharedModal; while ( next) { CWindow( next)-> cancel( next); next = var-> nextSharedModal; } } else { Handle mh = my-> get_horizon( self); Handle next = ( mh == application) ? PApplication(mh)-> sharedModal : PWindow(mh)-> nextSharedModal; while ( next) { if ( Widget_is_child( next, self)) { CWindow( next)-> cancel( next); next = PWindow(mh)-> nextSharedModal; } else next = PWindow(next)-> nextSharedModal; } } unprotect_object( self); }
/* * Cannot return nilHandle. */ Handle Application_map_focus( Handle self, Handle from) { Handle topFrame = my-> top_frame( self, from); Handle topShared; if ( var-> topExclModal) return ( topFrame == var-> topExclModal) ? from : var-> topExclModal; if ( !var-> topSharedModal && var-> modalHorizons. count == 0) return from; /* return from if no shared modals active */ if ( topFrame == self) { if ( !var-> topSharedModal) return from; topShared = var-> topSharedModal; } else { Handle horizon = ( !CWindow( topFrame)-> get_modalHorizon( topFrame)) ? CWindow( topFrame)-> get_horizon( topFrame) : topFrame; if ( horizon == self) topShared = var-> topSharedModal; else topShared = PWindow( horizon)-> topSharedModal; } return ( !topShared || ( topShared == topFrame)) ? from : topShared; }
Bool Menu_selected( Handle self, Bool set, Bool selected) { if ( !set) return CWindow( var-> owner)-> get_menu( var-> owner) == self; if ( var-> stage > csFrozen) return false; if ( selected) CWindow( var-> owner)-> set_menu( var-> owner, self); else if ( my-> get_selected( self)) CWindow( var-> owner)-> set_menu( var-> owner, nilHandle); return false; }
void CApplicationImpl::AddItemWindow(HWND hWnd) { // Calculate position of the new item window. CPoint pointTopLeft(0, 0); if (m_listItemWindows.empty()) { CWindow(hWnd).CenterWindow(); pointTopLeft = CWindowRect(hWnd).TopLeft(); } else { CWindowRect rcLast(m_listItemWindows.back().first); pointTopLeft.x = max(pointTopLeft.x, rcLast.left); pointTopLeft.y = max(pointTopLeft.y, rcLast.top); pointTopLeft.Offset(GetSystemMetrics(SM_CYCAPTION), GetSystemMetrics(SM_CYCAPTION)); CWindowRect rc(hWnd); rc.OffsetRect(pointTopLeft); CWindowRect rcDesktop(GetDesktopWindow()); if (!rcDesktop.PtInRect(rc.BottomRight())) { pointTopLeft.SetPoint(0, 0); } SetWindowPos(hWnd, NULL, pointTopLeft.x, pointTopLeft.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); } // add to the list m_listItemWindows.push_back(std::make_pair(hWnd, pointTopLeft)); }
LRESULT FMainFrameContainer::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { FRect rc; GetClientRect(&rc); CWindow(m_ActiveWindow).MoveWindow(&rc, TRUE); return 0; }
LRESULT PageSettingsTabs1::OnTabTitleChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { CWindow(GetDlgItem(IDC_TAB_TITLE)).GetWindowText(m_strTitle); // GetParent().SendMessage(UM_TAB_TITLE_CHANGED, 0, 0); GetParent().PostMessage(UM_TAB_TITLE_CHANGED, 0, 0); return 0; }
static Bool icon_notify ( Handle self, Handle child, Handle icon) { if ( kind_of( child, CWindow) && (( PWidget) child)-> options. optOwnerIcon) { CWindow( child)-> set_icon( child, icon); PWindow( child)-> options. optOwnerIcon = 1; } return false; }
LRESULT PageSettingsTabs1::OnTabShellChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { if( m_bUseDefaultIcon ) { CWindow(GetDlgItem(IDC_TAB_SHELL)).GetWindowText(m_strShell); GetParent().PostMessage(UM_TAB_ICON_CHANGED, 0, 0); } return 0; }
static Handle popup_win( Handle xTop) { PWindow_vmt top = CWindow( xTop); if ( !top-> get_visible( xTop)) top-> set_visible( xTop, 1); if ( top-> get_windowState( xTop) == wsMinimized) top-> set_windowState( xTop, wsNormal); top-> set_selected( xTop, 1); return xTop; }
LRESULT ShortRangeMapView::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { CRect rc; CWindow(GetDlgItem(IDC_STATIC_MAP)).GetWindowRect(rc); ScreenToClient(&rc); m_mapCtrl.Create(m_hWnd, rc); DlgResize_Init(false, true); return 1; }
Bool Window_execute_shared( Handle self, Handle insertBefore) { if ( var-> modal || var-> nextSharedModal) return false; if ( insertBefore && (( insertBefore == self) || ( !kind_of( insertBefore, CWindow)) || ( PWindow( insertBefore)-> modal != mtShared) || ( CWindow( insertBefore)-> get_horizon( insertBefore) != my-> get_horizon( self)))) insertBefore = nilHandle; return apc_window_execute_shared( self, insertBefore); }
Handle Application_popup_modal( Handle self) { Handle ha = apc_window_get_active(); Handle xTop; if ( var-> topExclModal) { /* checking exclusive modal chain */ xTop = ( !ha || ( PWindow(ha)->modal == 0)) ? var-> exclModal : ha; while ( xTop) { if ( PWindow(xTop)-> nextExclModal) { CWindow(xTop)-> bring_to_front( xTop); xTop = PWindow(xTop)-> nextExclModal; } else { return popup_win( xTop); } } } else { if ( !var-> topSharedModal && var-> modalHorizons. count == 0) return nilHandle; /* return from if no shared modals active */ /* checking shared modal chains */ if ( ha) { xTop = ( PWindow(ha)->modal == 0) ? CWindow(ha)->get_horizon(ha) : ha; if ( xTop == application) xTop = var-> sharedModal; } else xTop = var-> sharedModal ? var-> sharedModal : var-> modalHorizons. items[ 0]; while ( xTop) { if ( PWindow(xTop)-> nextSharedModal) { CWindow(xTop)-> bring_to_front( xTop); xTop = PWindow(xTop)-> nextSharedModal; } else { return popup_win( xTop); } } } return nilHandle; }
LRESULT DlgSettingsAppearance::OnClickedFontColor(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/) { CColorDialog dlg(m_fontSettings.crFontColor, CC_FULLOPEN); if (dlg.DoModal() == IDOK) { // update color m_fontSettings.crFontColor = dlg.GetColor(); CWindow(hWndCtl).Invalidate(); } return 0; }
LRESULT DlgSettingsStyles::OnClickedSelColor(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/) { CColorDialog dlg(m_stylesSettings.crSelectionColor, CC_FULLOPEN); if (dlg.DoModal() == IDOK) { // update color m_stylesSettings.crSelectionColor = dlg.GetColor(); CWindow(hWndCtl).Invalidate(); } return 0; }
LRESULT PageSettingsTabs1::OnClickedCursorColor(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/) { CColorDialog dlg(m_tabData->crCursorColor, CC_FULLOPEN); if (dlg.DoModal() == IDOK) { // update color m_tabData->crCursorColor = dlg.GetColor(); CWindow(hWndCtl).Invalidate(); } return 0; }
LRESULT DlgSettingsConsole::OnClickedClrBtn(WORD /*wNotifyCode*/, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/) { CColorDialog dlg(m_consoleSettings.consoleColors[wID-IDC_CLR_00], CC_FULLOPEN); if (dlg.DoModal() == IDOK) { // update color m_consoleSettings.consoleColors[wID-IDC_CLR_00] = dlg.GetColor(); CWindow(hWndCtl).Invalidate(); } return 0; }
Bool Window_ownerIcon( Handle self, Bool set, Bool ownerIcon) { if ( !set) return is_opt( optOwnerIcon); opt_assign( optOwnerIcon, ownerIcon); if ( is_opt( optOwnerIcon) && var-> owner) { Handle icon = ( var-> owner == application) ? CApplication( application)-> get_icon( application) : CWindow( var-> owner)-> get_icon( var-> owner); my-> set_icon( self, icon); opt_set( optOwnerIcon); } return false; }
LRESULT CDlgStgName::OnCloseCmd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { wNotifyCode, wID, hWndCtl, bHandled; if (wID==IDOK) { DoDataExchange(DDX_SAVE); if (lstrlen(m_szName) == 0) { CWindow(GetDlgItem(IDC_EDT_NAME)).SetFocus(); return 0; } } EndDialog(wID); return 0; }
LRESULT PageSettingsTabsColors::OnClickedClrBtn(WORD /*wNotifyCode*/, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/) { CColorDialog dlg(m_tabData->consoleColors[wID-IDC_CLR_00], CC_FULLOPEN); if (dlg.DoModal() == IDOK) { // update color m_tabData->consoleColors[wID-IDC_CLR_00] = dlg.GetColor(); CWindow(hWndCtl).Invalidate(); m_tabData->bInheritedColors = false; DoDataExchange(DDX_LOAD); } return 0; }
CStartWindow::CStartWindow ( void ) { CWindow(); /* Keine Titelbar! */ this->SetTitlebar ( 0 ); /* Fenster kann man nicht bewegen */ this->SetMoveAble ( false ); /* Größe und Position */ this->SetPosition( sf::Vector2f ( 0, 0 ) ); this->SetSize ( sf::Vector2f ( settings::GetWidth(), settings::GetWidth() ) ); /* Hintergrundbild */ this->SetBackgroundImage ( GetGameClass()->GetImgResource()->Get ( "themes/default/images/main.png" ) ); /* Buttons hinzufügen */ this->AddWidget ( new gui::CSingleplayerButton ); }
LRESULT CGetURLDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { SHINITDLGINFO shidi = { SHIDIM_FLAGS, m_hWnd, SHIDIF_SIZEDLGFULLSCREEN }; VERIFY(SHInitDialog(&shidi)); SHMENUBARINFO mbi = { sizeof(mbi), 0 }; mbi.hwndParent = m_hWnd; mbi.nToolBarId = IDR_GETURL_MENUBAR; // ID of toolbar resource mbi.hInstRes = _AtlBaseModule.GetResourceInstance(); VERIFY(SHCreateMenuBar(&mbi)); // For devices that have a back key (i.e. Smartphones), // override the back key since we have an edit control CWindow(mbi.hwndMB).SendMessage(SHCMBM_OVERRIDEKEY, VK_TBACK, MAKELPARAM(SHMBOF_NODEFAULT | SHMBOF_NOTIFY, SHMBOF_NODEFAULT | SHMBOF_NOTIFY)); VERIFY(SetDlgItemText(IDC_EDIT_URL, TEXT("http://"))); return 1; // Let the system set the focus }
LRESULT PageSettingsTabs1::OnTabIconChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { CWindow(GetDlgItem(IDC_TAB_ICON)).GetWindowText(m_strIcon); GetParent().PostMessage(UM_TAB_ICON_CHANGED, 0, 0); return 0; }