BOOL CDlgDepartureSlotSpec::OnInitDialog() { CXTResizeDialog::OnInitDialog(); CRect rectFltToolbar; GetDlgItem(IDC_STATIC_TOOLBAR)->GetWindowRect(&rectFltToolbar); ScreenToClient(&rectFltToolbar); m_wndFltToolbar.MoveWindow(&rectFltToolbar, true); m_wndFltToolbar.GetToolBarCtrl().EnableButton(ID_DEPSLOT_ADD, TRUE); m_wndFltToolbar.GetToolBarCtrl().HideButton(ID_DEPSLOT_EDIT, TRUE); m_wndFltToolbar.GetToolBarCtrl().EnableButton(ID_DEPSLOT_DEL, TRUE); SetResize(m_wndFltToolbar.GetDlgCtrlID(), SZ_TOP_LEFT, SZ_TOP_LEFT); SetResize(IDC_LISTBOX, SZ_TOP_LEFT , SZ_BOTTOM_RIGHT); SetResize(IDSAVE, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDOK, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDCANCEL, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); InitListCtrl(); GetDlgItem(IDSAVE)->EnableWindow(FALSE); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),TRUE); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),FALSE); return TRUE; }
BOOL CDlgIntersectionNodeBlock::OnInitDialog() { CXTResizeDialog::OnInitDialog(); DWORD dwStyle = m_lstNodeOption.GetExtendedStyle(); dwStyle |= LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_GRIDLINES; m_lstNodeOption.SetExtendedStyle( dwStyle ); m_wndSortableHeaderCtrl.SubclassWindow(m_lstNodeOption.GetHeaderCtrl()->m_hWnd ); // Create column m_lstNodeOption.InsertColumn( 0, "Node ID", LVCFMT_CENTER, 70 ); m_wndSortableHeaderCtrl.SetDataType( 0, dtINT ); m_lstNodeOption.InsertColumn( 1, "Node Name", LVCFMT_CENTER, 240 ); m_wndSortableHeaderCtrl.SetDataType( 1, dtSTRING ); m_lstNodeOption.InsertColumn( 2, "Block", LVCFMT_CENTER, 80 ); m_wndSortableHeaderCtrl.SetDataType( 2, dtINT ); SetResize(IDC_LIST_NODEBLOCK, SZ_TOP_LEFT,SZ_BOTTOM_RIGHT); SetResize(IDOK, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDCANCEL, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); InitNodeOption(); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),TRUE); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),FALSE); return TRUE; }
// CDlgDeiceQueue message handlers BOOL CDlgDeiceQueue::OnInitDialog() { CXTResizeDialog::OnInitDialog(); m_QueueList->ReadData(m_nProjID); GetDlgItem(IDC_BUTTON_SAVE)->EnableWindow(FALSE); DisplayDeicePad(); OnInitToolbar(); m_wndDeicePadToolbar.GetToolBarCtrl().EnableButton(ID_TOOLBAR_DEL,FALSE); m_wndQueueToolbar.GetToolBarCtrl().EnableButton(ID_TOOLBAR_QUEUE_ADD,FALSE); m_wndQueueToolbar.GetToolBarCtrl().EnableButton(ID_TOOLBAR_QUEUE_DEL,FALSE); GetAllDeicePad(); m_wndQueueToolbar.SetDlgCtrlID(m_wndDeicePadToolbar.GetDlgCtrlID()+1); SetResize(m_wndDeicePadToolbar.GetDlgCtrlID(), SZ_TOP_LEFT, SZ_TOP_LEFT); SetResize(m_wndQueueToolbar.GetDlgCtrlID(), SZ_TOP_CENTER, SZ_BOTTOM_CENTER); SetResize(IDC_STATIC_QUEUE, SZ_TOP_LEFT, SZ_BOTTOM_CENTER); SetResize(IDC_LIST_DEICEPAD, SZ_TOP_LEFT, SZ_BOTTOM_CENTER); SetResize(IDC_STATIC_PATH, SZ_TOP_CENTER, SZ_BOTTOM_RIGHT); SetResize(IDC_TREE_ROUTEPATH, SZ_TOP_CENTER, SZ_BOTTOM_RIGHT); SetResize(IDC_BUTTON_SAVE, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDOK, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDCANCEL, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),TRUE); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),FALSE); return TRUE; }
BOOL CPaneHierarchy::OnInitDialog() { gkToolBarPaneBase::OnInitDialog(); VERIFY(m_wndTreeHierarchy.Create(WS_VISIBLE|TVS_HASBUTTONS|TVS_LINESATROOT, CXTPEmptyRect(), this, 38985)); m_wndTreeHierarchy.SetItemHeight(18); m_wndTreeHierarchy.SetOwner(this); // TreeCtrl must be already created. CMFCUtils::LoadTrueColorImageList( m_imageList,IDB_SKB_ICONLIST,16,RGB(255,255,255) ); m_wndTreeHierarchy.SetImageList(&m_imageList,TVSIL_NORMAL); SetResize(IDC_TODSLIDER, SZ_TOP_LEFT, SZ_TOP_RIGHT); //RefreshMetrics(TRUE); RegisterPane(&m_wndTreeHierarchy, _T("Tree"), xtpPaneDockBottom); OpenPane(_T("Tree")); // // RegisterPane(&m_wndPropertyGrid, _T("Time Of Day Properties"), xtpPaneDockBottom); // OpenPane(_T("Time Of Day Properties")); InitToolBar(_T("ToolBar_Hierarchy"), IDR_TOOLBAR_HIERARCHY); return TRUE; }
int FrameScaler::Resize(BYTE *src,DWORD srcWidth,DWORD srcHeight,BYTE *dst,DWORD dstWidth,DWORD dstHeight) { //If sizes are the inot same if (srcWidth!=dstWidth ||srcHeight!=dstHeight) { //Set resize with full image SetResize(srcWidth,srcHeight,srcWidth,dstWidth,dstHeight,dstWidth); //Calc pointers DWORD srcPixels = srcWidth*srcHeight; BYTE *srcY = src; BYTE *srcU = src+srcPixels; BYTE *srcV = src+srcPixels*5/4; DWORD dstPixels = dstWidth*dstHeight; BYTE *dstY = dst; BYTE *dstU = dst+dstPixels; BYTE *dstV = dst+dstPixels*5/4; //Resize imgae Resize(srcY,srcU,srcV,dstY,dstU,dstV); } else { //Just copy memcpy(dst,src,srcWidth*srcHeight*3/2); } return 1; }
BOOL CBackstagePageRecent::OnInitDialog() { CXTPRibbonBackstagePage::OnInitDialog(); ModifyStyleEx(0, WS_EX_CONTROLPARENT); m_lblRecent.SetFont(&m_fntCaption); m_lblRecent.SetTextColor(RGB(94, 94, 94)); SetResize(IDC_SEPARATOR_1, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_TOPRIGHT); SetResize(IDC_RECENTFILELIST, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_BOTTOMRIGHT); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CBackstagePageSave::OnInitDialog() { CXTPRibbonBackstagePage::OnInitDialog(); ModifyStyleEx(0, WS_EX_CONTROLPARENT); m_lblSaveAndSend.SetFont(&m_fntCaption); m_lblSaveAndSend.SetTextColor(RGB(94, 94, 94)); m_lblFileTypes.SetFont(&m_fntCaption); m_lblFileTypes.SetTextColor(RGB(94, 94, 94)); m_lblSeparator4.SetVerticalStyle(TRUE); InitButton(m_btnSendEmail); InitButton(m_btnSaveToWeb); InitButton(m_btnSaveToSharePoint); InitButton(m_btnPublish); InitButton(m_btnChangeFileType); InitButton(m_btnCreatePDF); SetResize(IDC_SEPARATOR_4, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_BOTTOMLEFT); CXTPWindowRect rcPage(GetDlgItem(IDC_STATIC_PAGE)); ScreenToClient(rcPage); m_pageSaveEmail.Create(CBackstagePageSaveEmail::IDD, this); m_pageSaveEmail.SetDlgCtrlID(CBackstagePageSaveEmail::IDD); m_pageSaveEmail.MoveWindow(rcPage); m_pageSaveEmail.ShowWindow(SW_SHOWNORMAL); m_pageSaveWeb.Create(CBackstagePageSaveWeb::IDD, this); m_pageSaveWeb.MoveWindow(rcPage); m_pageSaveWeb.SetDlgCtrlID(CBackstagePageSaveWeb::IDD); SetResize(CBackstagePageSaveEmail::IDD, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_BOTTOMRIGHT); SetResize(CBackstagePageSaveWeb::IDD, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_BOTTOMRIGHT); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL CDlgItinerantTraffic::OnInitDialog() { CXTResizeDialog::OnInitDialog(); InitToolBar(); InitListCtrl(); GetAllStand(); m_pItinerantFlightList->SetAirportDB(m_pInputAirside->m_pAirportDB); m_pItinerantFlightSchedule->SetAirportDB(m_pInputAirside->m_pAirportDB); m_pItinerantFlightList->ReadData(m_nProjID); m_pItinerantFlightSchedule->ReadData(m_nProjID); SetListContent(); GetDlgItem(IDC_SAVE)->EnableWindow(FALSE); SetResize(IDC_STATIC_AREA, SZ_TOP_LEFT , SZ_BOTTOM_RIGHT); SetResize(IDC_LIST_CONTENTS, SZ_TOP_LEFT, SZ_BOTTOM_RIGHT); SetResize(IDC_VIEW_SCHEDULE, SZ_BOTTOM_LEFT , SZ_BOTTOM_LEFT); SetResize(IDC_UPDATE_SCHEDULE,SZ_BOTTOM_LEFT,SZ_BOTTOM_LEFT); SetResize(IDC_SAVE, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDOK, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDCANCEL, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),TRUE); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),FALSE); return TRUE; }
BOOL CTestDlg::OnInitDialog() { CBaseDialog::OnInitDialog(); CRect rect; GetClientRect(&rect); m_TestManTab.MoveWindow(rect); ControlsResizeProp item; // 设置“标签控件”的“可伸缩属性” m_TestManTab.GetClientRect(rect); item.ID = IDC_TestMan_Tab; item.ptOrigPosBps = rect.TopLeft(); // 重定位基点是左上顶点 item.ctmXofPosBps = tmNotChange; // 基点x坐标按比例放大 item.ctmYofPosBps = tmNotChange; // 基点y轴按比例放大 item.ctmWigth = tmQuantity; // 控件宽度按比例缩放 item.ctmHight = tmQuantity; // 控件长度按比例缩放 SetResize(item); m_TestManTab.InsertItem(ViewReagentArea,_T("试剂区配置")); m_TestManTab.InsertItem(ViewSampleArea,_T("样本区配置")); m_TestManTab.InsertItem(ViewTestConfirm,_T("新测试确认")); m_TestManTab.InsertItem(ViewMonitor,_T("测试进度监控")); CRect rcTabs; m_TestManTab.GetClientRect(&rcTabs); rcTabs.left += m_TestManTab.GetHeaderWidth(); // 创建“试剂区配置”对话框,并设置为初始显示状态 CReagentAreaManDlg * pReagentAreaManDlg = new CReagentAreaManDlg(&m_TestManTab); pReagentAreaManDlg->Create(IDD_ReagentAreaMan_Dlg,&m_TestManTab); m_mapChildViews[ViewReagentArea] = pReagentAreaManDlg; m_mapChildViews[ViewReagentArea]->MoveWindow(&rcTabs); m_mapChildViews[ViewReagentArea]->ShowWindow(SW_SHOW); // 创建“样本区配置”对话框 CSampleAreaManDlg * pSampleAreaManDlg = new CSampleAreaManDlg(&m_TestManTab); pSampleAreaManDlg->Create(IDD_SampleAreaMan_Dlg,&m_TestManTab); m_mapChildViews[ViewSampleArea] = pSampleAreaManDlg; m_mapChildViews[ViewSampleArea]->MoveWindow(&rcTabs); // 创建“测试确认”对话框 CNewTestConfirmDlg * pNewTestConfirmDlg = new CNewTestConfirmDlg(&m_TestManTab); pNewTestConfirmDlg->Create(IDD_NewTestConfirm_Dlg,&m_TestManTab); m_mapChildViews[ViewTestConfirm] = pNewTestConfirmDlg; m_mapChildViews[ViewTestConfirm]->MoveWindow(&rcTabs); // 创建“测试监控”对话框 CTestMonitorDlg * pTestMonitorDlg = new CTestMonitorDlg(&m_TestManTab); pTestMonitorDlg->Create(IDD_TestMonitor_Dlg,&m_TestManTab); m_mapChildViews[ViewMonitor] = pTestMonitorDlg; m_mapChildViews[ViewMonitor]->MoveWindow(&rcTabs); return TRUE; }
BOOL CXTPCustomizeToolbarsPage::OnInitDialog() { CXTPPropertyPage::OnInitDialog(); if (m_pSheet->GetCommandBars()->IsLayoutRTL()) { m_checkList.ModifyStyleEx(0, WS_EX_LAYOUTRTL); } RefreshToolbarsList(); m_btnNew.EnableWindow(m_bAllowNewToolbars); SetResize(XTP_IDC_LIST_TOOLBARS, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_BOTTOMRIGHT); SetResize(XTP_IDC_BUTTON_RENAME, XTP_ANCHOR_TOPRIGHT, XTP_ANCHOR_TOPRIGHT); SetResize(XTP_IDC_BUTTON_NEW, XTP_ANCHOR_TOPRIGHT, XTP_ANCHOR_TOPRIGHT); SetResize(XTP_IDC_BUTTON_DELETE, XTP_ANCHOR_TOPRIGHT, XTP_ANCHOR_TOPRIGHT); SetResize(XTP_IDC_BUTTON_RESET, XTP_ANCHOR_TOPRIGHT, XTP_ANCHOR_TOPRIGHT); return FALSE; }
// CPaneDialog message handlers BOOL CPaneDialog::OnInitDialog() { CPropertyGridDlgBase::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CRect rcWorkspace;//GetDlgItem(IDC_STATIC) this->GetWindowRect(rcWorkspace); ScreenToClient(rcWorkspace); if ( m_wndPropertyGrid.Create( rcWorkspace, this, IDC_PROPERTY_GRID ) ) { m_wndPropertyGrid.SetVariableItemsHeight(TRUE); LOGFONT lf; GetFont()->GetLogFont( &lf ); // create document settings category. CXTPPropertyGridItem* pSettings = m_wndPropertyGrid.AddCategory(_T("Document Settings")); m_wndPropertyGrid.SetTheme(xtpGridThemeNativeWinXP); pSettings->SetTooltip(_T("Document Settings Category")); // add child items to category. CXTPPropertyGridItem* pItemSaveOnClose = pSettings->AddChildItem(new CXTPPropertyGridItemBool(_T("SaveOnClose"), TRUE)); pSettings->AddChildItem(new CXTPPropertyGridItemFont(_T("WindowFont"), lf)); pSettings->AddChildItem(new CXTPPropertyGridItemSize(_T("WindowSize"), CSize(100, 100))); pSettings->Expand(); pItemSaveOnClose->Select(); // create global settings category. CXTPPropertyGridItem* pGlobals = m_wndPropertyGrid.AddCategory(_T("Global Settings")); // add child items to category. CXTPPropertyGridItem* pItemGreeting = pGlobals->AddChildItem(new CXTPPropertyGridItem(_T("Greeting Text"), _T("Welcome to your application!"))); pGlobals->AddChildItem(new CXTPPropertyGridItemNumber(_T("ItemsInMRUList"), 4)); CXTPPropertyGridItem* pItemRate = pGlobals->AddChildItem(new CXTPPropertyGridItemNumber(_T("MaxRepeatRate"), 10)); pGlobals->AddChildItem(new CXTPPropertyGridItemColor(_T("ToolbarColor"), RGB(255, 192,128))); pItemGreeting->SetReadOnly(TRUE); pItemRate->SetDescription(_T("The rate in milliseconds that the text will repeat.")); } // Set control resizing. SetResize(IDC_PROPERTY_GRID, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_BOTTOMRIGHT); return TRUE; // return TRUE unless you set the focus to a control }
BOOL CDlgTaxiwayConstraint::OnInitDialog() { CXTResizeDialog::OnInitDialog(); InitToolBar(); InitListCtrlEx(); SetListCtrlEx(); GetAllTaxiway(); LoadData(); //-----------------------------------------------------------------/ SetResize(m_taxiwayToolBar.GetDlgCtrlID(), SZ_TOP_LEFT, SZ_TOP_LEFT); SetResize(m_dataToolBar.GetDlgCtrlID(), SZ_TOP_CENTER, SZ_BOTTOM_CENTER); SetResize(IDC_GROUPBOX_TAXIWAY, SZ_TOP_LEFT, SZ_BOTTOM_CENTER); SetResize(IDC_LIST_TAXIWAY, SZ_TOP_LEFT, SZ_BOTTOM_CENTER); SetResize(IDC_GROUPBOX_CONSTRAINT, SZ_TOP_CENTER, SZ_BOTTOM_RIGHT); SetResize(IDC_LIST_DATA, SZ_TOP_CENTER, SZ_BOTTOM_RIGHT); SetResize(IDC_BUTTON_SAVE, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDC_BTN_WS_ADJCONS, SZ_BOTTOM_LEFT, SZ_BOTTOM_LEFT); SetResize(IDOK, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); SetResize(IDCANCEL, SZ_BOTTOM_RIGHT, SZ_BOTTOM_RIGHT); if(m_emType == WingSpanConstraint) { GetDlgItem(IDC_BTN_WS_ADJCONS)->ShowWindow(SW_SHOW); } else { GetDlgItem(IDC_BTN_WS_ADJCONS)->ShowWindow(SW_HIDE); } //-----------------------------------------------------------------/ SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),TRUE); SetIcon(LoadIcon( AfxGetInstanceHandle(),MAKEINTRESOURCE(IDR_MAINFRAME) ),FALSE); return TRUE; }
void UpdateConfig (void) { SetResize(CurrentConfig.Resize); SetAspect(CurrentConfig.Aspect); SetScanLines(CurrentConfig.ScanLines); SetFrameSkip(CurrentConfig.FrameSkip); SetAutoStart(CurrentConfig.AutoStart); SetSpeedThrottle(CurrentConfig.SpeedThrottle); SetCPUMultiplyer(CurrentConfig.CPUMultiplyer); SetRamSize(CurrentConfig.RamSize); SetCpuType(CurrentConfig.CpuType); SetMonitorType(CurrentConfig.MonitorType); SetCartAutoStart(CurrentConfig.CartAutoStart); if (CurrentConfig.RebootNow) { DoReboot(); } CurrentConfig.RebootNow = 0; }
BOOL CBackstagePageInfo::OnInitDialog() { CXTPRibbonBackstagePage::OnInitDialog(); ModifyStyleEx(0, WS_EX_CONTROLPARENT); m_lblInformation.SetFont(&m_fntTitle); m_lblInformation.SetTextColor(RGB(59, 59, 59)); m_lblPermissions.SetFont(&m_fntCaption); m_lblPermissions.SetTextColor(RGB(94, 94, 94)); m_lblPrepareForSharing.SetFont(&m_fntCaption); m_lblPrepareForSharing.SetTextColor(RGB(94, 94, 94)); m_lblVersions.SetFont(&m_fntCaption); m_lblVersions.SetTextColor(RGB(94, 94, 94)); m_lblSeparator4.SetVerticalStyle(TRUE); InitButton(IDC_BUTTON_PROTECTDOCUMENT, TRUE); InitButton(IDC_BUTTON_CHECKFORISSUE, TRUE); InitButton(IDC_BUTTON_MANAGEVERSIONS, FALSE); SetResize(IDC_SEPARATOR_1, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_TOPRIGHT); SetResize(IDC_SEPARATOR_2, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_TOPRIGHT); SetResize(IDC_SEPARATOR_3, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_TOPRIGHT); SetResize(IDC_SEPARATOR_4, XTP_ANCHOR_TOPRIGHT, XTP_ANCHOR_BOTTOMRIGHT); SetResize(IDC_STATIC_PREVIEW, XTP_ANCHOR_TOPRIGHT, XTP_ANCHOR_TOPRIGHT); SetResize(IDC_TEXT1, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_TOPRIGHT); SetResize(IDC_TEXT2, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_TOPRIGHT); SetResize(IDC_TEXT3, XTP_ANCHOR_TOPLEFT, XTP_ANCHOR_TOPRIGHT); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
// CPluginsDialog message handlers BOOL CPluginsDialog::OnInitDialog() { CXTResizeDialog::OnInitDialog(); SetResize(IDC_PLUGINS_LIST, SZ_TOP_LEFT, SZ_BOTTOM_RIGHT); PluginsList.InsertColumn(0, _T("ID"), LVCFMT_LEFT, 125); PluginsList.InsertColumn(1, _T("Name"), LVCFMT_LEFT, 125); PluginsList.InsertColumn(2, _T("Status"), LVCFMT_LEFT, 125); HWND hWndHeader = PluginsList.GetDlgItem(0)->GetSafeHwnd(); m_header.SubclassWindow(hWndHeader); m_header.EnableAutoSize(TRUE); m_header.ResizeColumnsToFit(); PluginsList.ModifyExtendedStyle( 0, LVS_EX_FULLROWSELECT ); PluginsList.ModifyExtendedStyle( 0,LVS_EX_GRIDLINES ); PluginsList.EnableUserRowColor(true); return true; }
BOOL gkTrackBusEditor::OnInitDialog() { gkToolBarPaneBase::OnInitDialog(); SetResize(IDC_MATEDTLIST, SZ_TOP_LEFT, SZ_BOTTOM_CENTER); //SetResize(IDC_MATEDTGRID, SZ_TOP_CENTER, SZ_BOTTOM_LEFT); RefreshMetrics(TRUE); // CRect rc; // GetClientRect(rc) // // m_wndPlaceHolder.Create(_T(""), WS_CHILD | WS_VISIBLE, rc, this); m_treeMaterialList.Create( WS_VISIBLE|WS_CHILD|WS_TABSTOP|WS_BORDER|TVS_HASBUTTONS|TVS_SHOWSELALWAYS|TVS_LINESATROOT|TVS_HASLINES| TVS_FULLROWSELECT|TVS_INFOTIP, CRect(0,0,100,400), this, AFX_IDW_PANE_FIRST ); m_treeMaterialList.SetItemHeight(18); // TreeCtrl must be already created. //CMFCUtils::LoadTrueColorImageList( m_imageList,IDB_MATEDTLIST,16,RGB(255,0,255) ); //CMFCUtils::LoadTrueColorImageList( m_imageList,IDB_FILE_STATUS,20,RGB(255,0,255) ); m_treeMaterialList.SetImageList(&m_imageList,TVSIL_NORMAL); InitPropertyTable(); RegisterPane(&m_treeMaterialList, _T("ActorList"), xtpPaneDockLeft); OpenPane(_T("MaterialBrowser")); RegisterPane(&m_wndPropertyGrid, _T("TrackView"), xtpPaneDockRight); OpenPane(_T("MaterialProperty")); // RegisterPane(&m_treeMaterialList, _T("MaterialBrowser2")); // OpenPane(_T("MaterialBrowser2")); InitToolBar(_T("ToolBar_MatEdt"), IDR_TOOLBAR_MATERIALEDITOR); return TRUE; }
static const NWidgetPart _nested_group_widgets[] = { NWidget(NWID_HORIZONTAL), // Window header NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, GRP_WIDGET_CAPTION), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(NWID_HORIZONTAL), /* left part */ NWidget(NWID_VERTICAL), NWidget(WWT_PANEL, COLOUR_GREY), SetMinimalTextLines(1, WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM), SetFill(1, 0), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, GRP_WIDGET_ALL_VEHICLES), SetMinimalSize(200, 13), SetFill(1, 0), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, GRP_WIDGET_DEFAULT_VEHICLES), SetMinimalSize(200, 13), SetFill(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, GRP_WIDGET_LIST_GROUP), SetMinimalSize(188, 0), SetDataTip(0x701, STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP), SetFill(1, 0), SetResize(0, 1), SetScrollbar(GRP_WIDGET_LIST_GROUP_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, GRP_WIDGET_LIST_GROUP_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, GRP_WIDGET_GROUP_INFO), SetMinimalSize(200, 25), SetFill(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, GRP_WIDGET_CREATE_GROUP), SetMinimalSize(24, 25), SetFill(0, 1), SetDataTip(SPR_GROUP_CREATE_TRAIN, STR_GROUP_CREATE_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, GRP_WIDGET_DELETE_GROUP), SetMinimalSize(24, 25), SetFill(0, 1), SetDataTip(SPR_GROUP_DELETE_TRAIN, STR_GROUP_DELETE_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, GRP_WIDGET_RENAME_GROUP), SetMinimalSize(24, 25), SetFill(0, 1), SetDataTip(SPR_GROUP_RENAME_TRAIN, STR_GROUP_RENAME_TOOLTIP), NWidget(WWT_PANEL, COLOUR_GREY), SetMinimalSize(92, 25), SetFill(1, 1), EndContainer(), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, GRP_WIDGET_REPLACE_PROTECTION), SetMinimalSize(24, 25), SetFill(0, 1), SetDataTip(SPR_GROUP_REPLACE_OFF_TRAIN, STR_GROUP_REPLACE_PROTECTION_TOOLTIP), NWidget(WWT_PANEL, COLOUR_GREY), SetMinimalSize(12, 25), SetFill(0, 1), EndContainer(), EndContainer(),
if (_game_mode != GM_MENU) { ViewPort *vp = w->viewport; if ((in && vp->zoom <= _settings_client.gui.zoom_min) || (!in && vp->zoom >= _settings_client.gui.zoom_max)) return; Point pt = GetTileZoomCenterWindow(in, w); if (pt.x != -1) { ScrollWindowTo(pt.x, pt.y, -1, w, true); DoZoomInOutWindow(in ? ZOOM_IN : ZOOM_OUT, w); } } } static const struct NWidgetPart _nested_main_window_widgets[] = { NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_M_VIEWPORT), SetResize(1, 1), }; enum { GHK_QUIT, GHK_ABANDON, GHK_CONSOLE, GHK_BOUNDING_BOXES, GHK_DIRTY_BLOCKS, GHK_CENTER, GHK_CENTER_ZOOM, GHK_RESET_OBJECT_TO_PLACE, GHK_DELETE_WINDOWS, GHK_DELETE_NONVITAL_WINDOWS, GHK_REFRESH_SCREEN, GHK_CRASH,
NWidget(WWT_MATRIX, COLOUR_GREY, WID_BO_CLASS_LIST), SetFill(1, 0), SetMatrixDataTip(1, 0, STR_OBJECT_BUILD_CLASS_TOOLTIP), SetScrollbar(WID_BO_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_BO_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), SetPadding(0, 5, 0, 5), NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, WID_BO_OBJECT_MATRIX), SetPIP(0, 2, 0), NWidget(WWT_PANEL, COLOUR_GREY, WID_BO_OBJECT_SPRITE), SetDataTip(0x0, STR_OBJECT_BUILD_PREVIEW_TOOLTIP), EndContainer(), EndContainer(), EndContainer(), NWidget(WWT_TEXT, COLOUR_DARK_GREEN, WID_BO_OBJECT_NAME), SetDataTip(STR_ORANGE_STRING, STR_NULL), SetPadding(2, 5, 2, 5), NWidget(WWT_TEXT, COLOUR_DARK_GREEN, WID_BO_OBJECT_SIZE), SetDataTip(STR_OBJECT_BUILD_SIZE, STR_NULL), SetPadding(2, 5, 2, 5), EndContainer(), NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetScrollbar(WID_BO_SELECT_SCROLL), NWidget(NWID_HORIZONTAL), NWidget(NWID_MATRIX, COLOUR_DARK_GREEN, WID_BO_SELECT_MATRIX), SetFill(0, 1), SetPIP(0, 2, 0), NWidget(WWT_PANEL, COLOUR_DARK_GREEN, WID_BO_SELECT_IMAGE), SetMinimalSize(66, 60), SetDataTip(0x0, STR_OBJECT_BUILD_TOOLTIP), SetFill(0, 0), SetResize(0, 0), SetScrollbar(WID_BO_SELECT_SCROLL), EndContainer(), EndContainer(), NWidget(NWID_VSCROLLBAR, COLOUR_DARK_GREEN, WID_BO_SELECT_SCROLL), EndContainer(), EndContainer(), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_EMPTY, INVALID_COLOUR, WID_BO_INFO), SetPadding(2, 5, 0, 5), SetFill(1, 0), SetResize(1, 0), NWidget(NWID_VERTICAL), NWidget(WWT_PANEL, COLOUR_DARK_GREEN), SetFill(0, 1), EndContainer(), NWidget(WWT_RESIZEBOX, COLOUR_DARK_GREEN), EndContainer(), EndContainer(), EndContainer(), };
Widget(WT_CLOSEBOX, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), EndContainer(), /* Ride types bar. */ Widget(WT_PANEL, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), Intermediate(2, 1), Intermediate(1, 0), Widget(WT_LEFT_FILLER_TAB, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), Widget(WT_TEXT_TAB, RSEL_SHOPS, COL_RANGE_DARK_GREEN), SetData(GUI_RIDE_SELECT_SHOPS, GUI_RIDE_SELECT_SHOPS_TOOLTIP), Widget(WT_TEXT_TAB, RSEL_GENTLE, COL_RANGE_DARK_GREEN), SetData(GUI_RIDE_SELECT_GENTLE, GUI_RIDE_SELECT_GENTLE_TOOLTIP), Widget(WT_TEXT_TAB, RSEL_WET, COL_RANGE_DARK_GREEN), SetData(GUI_RIDE_SELECT_WET, GUI_RIDE_SELECT_WET_TOOLTIP), Widget(WT_TEXT_TAB, RSEL_COASTER, COL_RANGE_DARK_GREEN), SetData(GUI_RIDE_SELECT_COASTER, GUI_RIDE_SELECT_COASTER_TOOLTIP), Widget(WT_RIGHT_FILLER_TAB, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), SetFill(1,0), SetResize(1, 0), EndContainer(), /* Available rides. */ Widget(WT_TAB_PANEL, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), Intermediate(1, 3), Widget(WT_EMPTY, RSEL_LIST, COL_RANGE_DARK_GREEN), SetFill(0, 1), SetResize(0, 1), SetMinimalSize(100, 100), Widget(WT_VERT_SCROLLBAR, RSEL_SCROLL_LIST, COL_RANGE_DARK_GREEN), Intermediate(3, 1), Widget(WT_EMPTY, RSEL_DESC, COL_RANGE_DARK_GREEN), SetFill(1, 1), SetResize(1, 1), SetMinimalSize(200, 200), Intermediate(1, 2), Widget(WT_EMPTY, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), SetFill(1, 1), SetResize(1, 0), Widget(WT_EMPTY, RSEL_DISPLAY, COL_RANGE_DARK_GREEN), SetMinimalSize(70, 70), Intermediate(1, 2), Widget(WT_EMPTY, INVALID_WIDGET_INDEX, COL_RANGE_DARK_GREEN), SetFill(1, 1), SetResize(1, 0), Widget(WT_TEXT_BUTTON, RSEL_SELECT, COL_RANGE_DARK_GREEN), SetPadding(0, 3, 3, 0), SetFill(1, 1), SetData(GUI_RIDE_SELECT_RIDE, GUI_RIDE_SELECT_RIDE_TOOLTIP),
static const NWidgetPart _nested_build_vehicle_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, WID_BV_CAPTION), SetDataTip(STR_WHITE_STRING, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), NWidget(NWID_HORIZONTAL), NWidget(NWID_VERTICAL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BV_SORT_ASSENDING_DESCENDING), SetDataTip(STR_BUTTON_SORT_BY, STR_TOOLTIP_SORT_ORDER), SetFill(1, 0), NWidget(NWID_SPACER), SetFill(1, 1), EndContainer(), NWidget(NWID_VERTICAL), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_BV_SORT_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_SORT_CRITERIA), NWidget(WWT_DROPDOWN, COLOUR_GREY, WID_BV_CARGO_FILTER_DROPDOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_JUST_STRING, STR_TOOLTIP_FILTER_CRITERIA), EndContainer(), EndContainer(), EndContainer(), /* Vehicle list. */ NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, WID_BV_LIST), SetResize(1, 1), SetFill(1, 0), SetDataTip(0x101, STR_NULL), SetScrollbar(WID_BV_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_BV_SCROLLBAR), EndContainer(), /* Panel with details. */ NWidget(WWT_PANEL, COLOUR_GREY, WID_BV_PANEL), SetMinimalSize(240, 122), SetResize(1, 0), EndContainer(), /* Build/rename buttons, resize button. */ NWidget(NWID_HORIZONTAL), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_BV_BUILD_SEL), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BV_BUILD), SetResize(1, 0), SetFill(1, 0),
#include "departures_func.h" #include "cargotype.h" #include "table/sprites.h" #include "table/strings.h" static const NWidgetPart _nested_departures_list[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, WID_DB_CAPTION), SetDataTip(STR_DEPARTURES_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, WID_DB_LIST), SetMinimalSize(0, 0), SetFill(1, 0), SetResize(1, 1), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_DB_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY), SetMinimalSize(0, 12), SetResize(1, 0), SetFill(1, 1), EndContainer(), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_DB_SHOW_DEPS), SetMinimalSize(6, 12), SetFill(0, 1), SetDataTip(STR_DEPARTURES_DEPARTURES, STR_DEPARTURES_DEPARTURES_TOOLTIP), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_DB_SHOW_ARRS), SetMinimalSize(6, 12), SetFill(0, 1), SetDataTip(STR_DEPARTURES_ARRIVALS, STR_DEPARTURES_ARRIVALS_TOOLTIP), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_DB_SHOW_VIA), SetMinimalSize(11, 12), SetFill(0, 1), SetDataTip(STR_DEPARTURES_VIA_BUTTON, STR_DEPARTURES_VIA_TOOLTIP), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_DB_SHOW_TRAINS), SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_TRAIN, STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_DB_SHOW_ROADVEHS), SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_LORRY, STR_STATION_VIEW_SCHEDULED_ROAD_VEHICLES_TOOLTIP), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_DB_SHOW_SHIPS), SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_SHIP, STR_STATION_VIEW_SCHEDULED_SHIPS_TOOLTIP), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_DB_SHOW_PLANES), SetMinimalSize(14, 12), SetFill(0, 1), SetDataTip(STR_PLANE, STR_STATION_VIEW_SCHEDULED_AIRCRAFT_TOOLTIP), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(), };
NWidget(NWID_HORIZONTAL), // Window header NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, WID_GL_CAPTION), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_DEFSIZEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(NWID_HORIZONTAL), /* left part */ NWidget(NWID_VERTICAL), NWidget(WWT_PANEL, COLOUR_GREY), SetMinimalTextLines(1, WD_DROPDOWNTEXT_TOP + WD_DROPDOWNTEXT_BOTTOM), SetFill(1, 0), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_GL_ALL_VEHICLES), SetFill(1, 0), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_GL_DEFAULT_VEHICLES), SetFill(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_GREY, WID_GL_LIST_GROUP), SetMatrixDataTip(1, 0, STR_GROUPS_CLICK_ON_GROUP_FOR_TOOLTIP), SetFill(1, 0), SetResize(0, 1), SetScrollbar(WID_GL_LIST_GROUP_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_GL_LIST_GROUP_SCROLLBAR), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_CREATE_GROUP), SetFill(0, 1), SetDataTip(SPR_GROUP_CREATE_TRAIN, STR_GROUP_CREATE_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_DELETE_GROUP), SetFill(0, 1), SetDataTip(SPR_GROUP_DELETE_TRAIN, STR_GROUP_DELETE_TOOLTIP), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_RENAME_GROUP), SetFill(0, 1), SetDataTip(SPR_GROUP_RENAME_TRAIN, STR_GROUP_RENAME_TOOLTIP), NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), EndContainer(), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_GL_REPLACE_PROTECTION), SetFill(0, 1), SetDataTip(SPR_GROUP_REPLACE_OFF_TRAIN, STR_GROUP_REPLACE_PROTECTION_TOOLTIP), EndContainer(), EndContainer(), /* right part */
DrawString(pt.x + 40, pt.x + 600, pt.y + 140 + (i * 55), STR_HIGHSCORE_POSITION); if (hs[i].company[0] != '\0') { TextColour colour = (this->rank == i) ? TC_RED : TC_BLACK; // draw new highscore in red DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + (i * 55), hs[i].company, colour); SetDParam(0, hs[i].title); SetDParam(1, hs[i].score); DrawString(pt.x + 71, pt.x + 569, pt.y + 140 + FONT_HEIGHT_LARGE + (i * 55), STR_HIGHSCORE_STATS, colour); } } } }; static const NWidgetPart _nested_highscore_widgets[] = { NWidget(WWT_PANEL, COLOUR_END, HSW_BACKGROUND), SetMinimalSize(641, 481), SetResize(1, 1), EndContainer(), }; static const WindowDesc _highscore_desc( WDP_MANUAL, 0, 0, WC_HIGHSCORE, WC_NONE, 0, _nested_highscore_widgets, lengthof(_nested_highscore_widgets) ); static const WindowDesc _endgame_desc( WDP_MANUAL, 0, 0, WC_ENDSCREEN, WC_NONE, 0, _nested_highscore_widgets, lengthof(_nested_highscore_widgets) );
static inline void IConsoleResetHistoryPos() { _iconsole_historypos = ICON_HISTORY_SIZE - 1; } static const char *IConsoleHistoryAdd(const char *cmd); static void IConsoleHistoryNavigate(int direction); /** Widgets of the console window. */ enum ConsoleWidgets { CW_BACKGROUND, ///< Background of the console }; static const struct NWidgetPart _nested_console_window_widgets[] = { NWidget(WWT_EMPTY, INVALID_COLOUR, CW_BACKGROUND), SetResize(1, 1), }; static const WindowDesc _console_window_desc( WDP_MANUAL, 0, 0, WC_CONSOLE, WC_NONE, 0, _nested_console_window_widgets, lengthof(_nested_console_window_widgets) ); struct IConsoleWindow : Window { static int scroll; int line_height; ///< Height of one line of text in the console. int line_offset;
TWA_CAPTION, TWA_RATING_INFO, ///< Overview with ratings for each company. TWA_COMMAND_LIST, ///< List of commands for the player. TWA_SCROLLBAR, TWA_ACTION_INFO, ///< Additional information about the action. TWA_EXECUTE, ///< Do-it button. }; static const NWidgetPart _nested_town_authority_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_BROWN), NWidget(WWT_CAPTION, COLOUR_BROWN, TWA_CAPTION), SetDataTip(STR_LOCAL_AUTHORITY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_SHADEBOX, COLOUR_BROWN), NWidget(WWT_STICKYBOX, COLOUR_BROWN), EndContainer(), NWidget(WWT_PANEL, COLOUR_BROWN, TWA_RATING_INFO), SetMinimalSize(317, 92), SetResize(1, 1), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_BROWN, TWA_COMMAND_LIST), SetMinimalSize(305, 52), SetResize(1, 0), SetDataTip(0x0, STR_LOCAL_AUTHORITY_ACTIONS_TOOLTIP), SetScrollbar(TWA_SCROLLBAR), EndContainer(), NWidget(NWID_VSCROLLBAR, COLOUR_BROWN, TWA_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_BROWN, TWA_ACTION_INFO), SetMinimalSize(317, 52), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHTXTBTN, COLOUR_BROWN, TWA_EXECUTE), SetMinimalSize(317, 12), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_LOCAL_AUTHORITY_DO_IT_BUTTON, STR_LOCAL_AUTHORITY_DO_IT_TOOLTIP), NWidget(WWT_RESIZEBOX, COLOUR_BROWN), EndContainer() }; /** Town authority window. */ struct TownAuthorityWindow : Window { private: Town *town; ///< Town being displayed.
BOOL CXTPResizePropertySheet::OnInitDialog() { CRect rcClientBegin, rcClientEnd; GetWindowRect(rcClientBegin); SendMessage(WM_NCCALCSIZE, FALSE, (LPARAM)(LPRECT)rcClientBegin); // Modify the window style to include WS_THICKFRAME for resizing. ::SetWindowLong(m_hWnd, GWL_STYLE, GetStyle() | WS_THICKFRAME); GetWindowRect(rcClientEnd); SendMessage(WM_NCCALCSIZE, FALSE, (LPARAM)(LPRECT)rcClientEnd); CPropertySheet::OnInitDialog(); // subclass our "flicker-free" tab control. m_tabCtrl.SubclassWindow(GetTabControl()->m_hWnd); // the size icon is too close to the buttons, so inflate the sheet CRect rc; GetWindowRect(rc); if (rcClientBegin.Width() - rcClientEnd.Width() > 3) { rc.InflateRect((rcClientBegin.Width() - rcClientEnd.Width()) / 2, (rcClientBegin.Height() - rcClientEnd.Height()) / 2); MoveWindow(rc); } // Do this last so that any prop pages are moved accordingly else if (!HasFlag(xtpResizeNoSizeIcon) && !IsWizard()) { rc.InflateRect(1, 1, 2, 2); MoveWindow(rc); } // add sizing entries to the system menu CMenu* pSysMenu = (CMenu*)GetSystemMenu(FALSE); if (pSysMenu) { CString szMaximize, szMinimize, szSize, szRestore; // try to get the strings from the topmost window CWnd* pwndTop; for (pwndTop = this; pwndTop->GetParent(); pwndTop = pwndTop->GetParent()); CMenu* pTopSysMenu = (CMenu*)pwndTop->GetSystemMenu(FALSE); if (pTopSysMenu) { pTopSysMenu->GetMenuString(SC_MAXIMIZE, szMaximize, MF_BYCOMMAND); pTopSysMenu->GetMenuString(SC_MINIMIZE, szMinimize, MF_BYCOMMAND); pTopSysMenu->GetMenuString(SC_SIZE, szSize, MF_BYCOMMAND); pTopSysMenu->GetMenuString(SC_RESTORE, szRestore, MF_BYCOMMAND); } // if we din't get the strings then set them to the English defaults if (szMaximize.IsEmpty()) szMaximize = _T("Ma&ximize"); if (szMinimize.IsEmpty()) szMinimize = _T("Mi&nimize"); if (szSize.IsEmpty()) szSize = _T("&Size"); if (szRestore.IsEmpty()) szRestore = _T("&Restore"); pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_SEPARATOR, 0, (LPCTSTR) 0); pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_STRING, SC_MAXIMIZE, szMaximize); pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_STRING, SC_MINIMIZE, szMinimize); pSysMenu->InsertMenu(1, MF_BYPOSITION | MF_STRING, SC_SIZE, szSize); pSysMenu->InsertMenu(0, MF_BYPOSITION | MF_STRING, SC_RESTORE, szRestore); } DWORD dwStyle = ::GetWindowLong(m_hWnd, GWL_STYLE); if ((dwStyle & WS_THICKFRAME) == 0) { SetFlag(xtpResizeNoSizeIcon); } CXTPResize::Init(); // Check which buttons are available in sheet or wizard if (IsWizard()) { SetResize(ID_WIZBACK, XTP_ATTR_REPOS(1)); SetResize(ID_WIZNEXT, XTP_ATTR_REPOS(1)); SetResize(ID_WIZFINISH, XTP_ATTR_REPOS(1)); SetResize(ID_WIZLINE, XTP_ANCHOR_BOTTOMLEFT, XTP_ANCHOR_BOTTOMRIGHT); } else { SetResize(IDOK, XTP_ATTR_REPOS(1)); SetResize(ID_APPLY_NOW, XTP_ATTR_REPOS(1)); SetResize(AFX_IDC_TAB_CONTROL, XTP_ATTR_RESIZE(1)); } SetResize(IDCANCEL, XTP_ATTR_REPOS(1)); SetResize(IDHELP, XTP_ATTR_REPOS(1)); // set page sizings CRect rcPage; GetActivePage()->GetWindowRect(rcPage); ScreenToClient(rcPage); int i; for (i = 0; i <GetPageCount(); i++) { SetResize(GetPage(i), XTP_ATTR_RESIZE(1), rcPage); } return TRUE; }
Filtering NewGRFAddWindow::last_filtering = {false, 0}; NewGRFAddWindow::GUIGRFConfigList::SortFunction * const NewGRFAddWindow::sorter_funcs[] = { &NameSorter, }; NewGRFAddWindow::GUIGRFConfigList::FilterFunction * const NewGRFAddWindow::filter_funcs[] = { &TagNameFilter, }; static const NWidgetPart _nested_newgrf_add_dlg_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_NEWGRF_ADD_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), SetResize(1, 0), NWidget(NWID_HORIZONTAL), SetPadding(WD_TEXTPANEL_TOP, 0, WD_TEXTPANEL_BOTTOM, 0), SetPIP(WD_FRAMETEXT_LEFT, WD_FRAMETEXT_RIGHT, WD_FRAMETEXT_RIGHT), NWidget(WWT_TEXT, COLOUR_GREY), SetFill(0, 1), SetDataTip(STR_LIST_FILTER_TITLE, STR_NULL), NWidget(WWT_EDITBOX, COLOUR_GREY, ANGRFW_FILTER), SetFill(1, 0), SetMinimalSize(100, 12), SetResize(1, 0), SetDataTip(STR_LIST_FILTER_OSKTITLE, STR_LIST_FILTER_TOOLTIP), EndContainer(), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY), NWidget(WWT_INSET, COLOUR_GREY, ANGRFW_GRF_LIST), SetMinimalSize(290, 1), SetResize(1, 1), SetPadding(2, 2, 2, 2), EndContainer(), EndContainer(), NWidget(WWT_SCROLLBAR, COLOUR_GREY, ANGRFW_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, ANGRFW_GRF_INFO), SetMinimalSize(306, 1), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ANGRFW_ADD), SetMinimalSize(147, 12), SetResize(1, 0), SetDataTip(STR_NEWGRF_ADD_FILE, STR_NEWGRF_ADD_FILE_TOOLTIP),
{ this->GetWidget<NWidgetStacked>(WID_VT_ARRIVAL_DEPARTURE_SELECTION)->SetDisplayedPlane(_settings_client.gui.timetable_arrival_departure ? 0 : SZSP_NONE); this->GetWidget<NWidgetStacked>(WID_VT_EXPECTED_SELECTION)->SetDisplayedPlane(_settings_client.gui.timetable_arrival_departure ? 0 : 1); } }; static const NWidgetPart _nested_timetable_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, WID_VT_CAPTION), SetDataTip(STR_TIMETABLE_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_ORDER_VIEW), SetMinimalSize(61, 14), SetDataTip( STR_TIMETABLE_ORDER_VIEW, STR_TIMETABLE_ORDER_VIEW_TOOLTIP), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY, WID_VT_TIMETABLE_PANEL), SetMinimalSize(388, 82), SetResize(1, 10), SetDataTip(STR_NULL, STR_TIMETABLE_TOOLTIP), SetScrollbar(WID_VT_SCROLLBAR), EndContainer(), NWidget(NWID_SELECTION, INVALID_COLOUR, WID_VT_ARRIVAL_DEPARTURE_SELECTION), NWidget(WWT_PANEL, COLOUR_GREY, WID_VT_ARRIVAL_DEPARTURE_PANEL), SetMinimalSize(110, 0), SetFill(0, 1), SetDataTip(STR_NULL, STR_TIMETABLE_TOOLTIP), SetScrollbar(WID_VT_SCROLLBAR), EndContainer(), EndContainer(), NWidget(NWID_VSCROLLBAR, COLOUR_GREY, WID_VT_SCROLLBAR), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY, WID_VT_SUMMARY_PANEL), SetMinimalSize(400, 22), SetResize(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(NWID_VERTICAL, NC_EQUALSIZE), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_CHANGE_TIME), SetResize(1, 0), SetFill(1, 1), SetDataTip(STR_TIMETABLE_CHANGE_TIME, STR_TIMETABLE_WAIT_TIME_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_CLEAR_TIME), SetResize(1, 0), SetFill(1, 1), SetDataTip(STR_TIMETABLE_CLEAR_TIME, STR_TIMETABLE_CLEAR_TIME_TOOLTIP), EndContainer(), NWidget(NWID_VERTICAL, NC_EQUALSIZE), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_CHANGE_SPEED), SetResize(1, 0), SetFill(1, 1), SetDataTip(STR_TIMETABLE_CHANGE_SPEED, STR_TIMETABLE_CHANGE_SPEED_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_VT_CLEAR_SPEED), SetResize(1, 0), SetFill(1, 1), SetDataTip(STR_TIMETABLE_CLEAR_SPEED, STR_TIMETABLE_CLEAR_SPEED_TOOLTIP),
#include "widgets/viewport_widget.h" #include "table/strings.h" #include "table/sprites.h" /* Extra ViewPort Window Stuff */ static const NWidgetPart _nested_extra_view_port_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY, WID_EV_CAPTION), SetDataTip(STR_EXTRA_VIEW_PORT_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_SHADEBOX, COLOUR_GREY), NWidget(WWT_DEFSIZEBOX, COLOUR_GREY), NWidget(WWT_STICKYBOX, COLOUR_GREY), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), NWidget(NWID_VIEWPORT, INVALID_COLOUR, WID_EV_VIEWPORT), SetPadding(2, 2, 2, 2), SetResize(1, 1), SetFill(1, 1), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_EV_ZOOM_IN), SetDataTip(SPR_IMG_ZOOMIN, STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_IN), NWidget(WWT_PUSHIMGBTN, COLOUR_GREY, WID_EV_ZOOM_OUT), SetDataTip(SPR_IMG_ZOOMOUT, STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_OUT), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_EV_MAIN_TO_VIEW), SetFill(1, 1), SetResize(1, 0), SetDataTip(STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW, STR_EXTRA_VIEW_MOVE_MAIN_TO_VIEW_TT), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_EV_VIEW_TO_MAIN), SetFill(1, 1), SetResize(1, 0), SetDataTip(STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN, STR_EXTRA_VIEW_MOVE_VIEW_TO_MAIN_TT), EndContainer(), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_PANEL, COLOUR_GREY), SetFill(1, 1), SetResize(1, 0), EndContainer(), NWidget(WWT_RESIZEBOX, COLOUR_GREY), EndContainer(),