HRESULT CMenuToolbarBase::UpdateImageLists() { if ((m_initFlags & (SMINIT_TOPLEVEL | SMINIT_VERTICAL)) == SMINIT_TOPLEVEL) // not vertical. { // No image list, prevents the buttons from having a margin at the left side SetImageList(NULL); return S_OK; } // Assign the correct imagelist and padding based on the current icon size int shiml; if (m_menuBand->UseBigIcons()) { shiml = SHIL_LARGE; SetPadding(4, 0); } else { shiml = SHIL_SMALL; SetPadding(4, 4); } IImageList * piml; HRESULT hr = SHGetImageList(shiml, IID_PPV_ARG(IImageList, &piml)); if (FAILED_UNEXPECTEDLY(hr)) { SetImageList(NULL); } else { SetImageList((HIMAGELIST)piml); } return S_OK; }
bool TaskToolbar::Create(CWnd* parent, UINT id, bool vertical) { static const int commands[]= { ID_VIEW, ID_TASK_TRANSFER, ID_TASK_COPY, ID_TASK_MOVE, ID_TASK_RENAME, ID_TASK_COPY_TAGGED, ID_TASK_RESIZE, ID_TASK_ROTATE, ID_TASK_EDIT_IPTC, ID_TASK_GEN_SLIDE_SHOW, ID_TASK_GEN_HTML_ALBUM, ID_BUILD_CATALOG, ID_TASK_PRINT, ID_TASK_EXPORT, ID_TASK_HISTOGRAM, ID_TASK_TOUCH_UP, ID_SEND_EMAIL, ID_DATE_TIME_ADJ, ID_TASK_EXTRACT_JPEG, ID_TASK_DELETE }; if (vertical) SetPadding(0, 0); else SetPadding(0, 4); small_icons_ = AfxGetApp()->GetProfileInt(REGISTRY_SECTION_TOOLBAR, REG_ICONS, 0) == 0; int bmp_id= small_icons_ ? TOOLBAR_BITMAP_SMALL : TOOLBAR_BITMAP_BIG; DWORD tb_style= WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | TBSTYLE_TRANSPARENT | /*CCS_TOP |*/ CCS_NORESIZE | CCS_NOPARENTALIGN | CCS_NODIVIDER | TBSTYLE_ALTDRAG | CCS_ADJUSTABLE; if (vertical) tb_style |= CCS_RIGHT; else tb_style |= CCS_TOP; if (!CToolBarCtrl::Create(tb_style, CRect(0,0,0,0), parent, id)) return false; int w= 0; { CClientDC dc(parent); dc.SelectStockObject(DEFAULT_GUI_FONT); w = dc.GetTextExtent(_T("NNNNNNa"), 7).cx; } // limit button width to make labels wrap if (vertical) w = w * 13 / 10; SendMessage(TB_SETBUTTONWIDTH, 0, MAKELONG(w, w)); SendMessage(TB_SETDRAWTEXTFLAGS, DT_WORDBREAK, DT_WORDBREAK); SendMessage(TB_SETDRAWTEXTFLAGS, DT_SINGLELINE, 0); SendMessage(TB_SETMAXTEXTROWS, vertical ? 1 : 2, 0); AddButtons("P|PPPPP|PPPPPPPPPPPPPP", commands, bmp_id, IDS_BROWSER_TOOLS, vertical); CreateDisabledImageList(bmp_id, saturation, lightness, alpha); DeleteButtons(); return true; }
TreeViewItem::TreeViewItem() : _showDotLine(false) , _internalIndent(0) { SetClassName(_T("TreeViewItem")); WriteFlag(CoreFlags::IsSupportMouseOver, true); SetHorizontalContentAlignment(HoriContentAlignment::Left); SetVerticalContentAlignment(VertContentAlignment::Center); SetPadding(suic::Rect(2,0,0,0)); _check.SetAutoDelete(false); _icon.SetAutoDelete(false); _expand = new TreeButton(); _check.SetVerticalAlignment(VertAlignment::Center); _icon.SetVerticalAlignment(VertAlignment::Center); _expand->SetVerticalAlignment(VertAlignment::Center); _headerHost->AddChild(_expand.get()); _headerHost->AddChild(&_check); _headerHost->AddChild(&_icon); SetHeader(new ui::Label()); _header->SetMinHeight(16); }
void UAutoFoldingSlot::SynchronizeProperties() { SetPadding(Padding); SetSize(Size); SetHorizontalAlignment(HorizontalAlignment); SetVerticalAlignment(VerticalAlignment); }
GWEN_CONTROL_CONSTRUCTOR(Menu, ScrollControl) { SetBounds(0, 0, 10, 10); SetDeleteOnClose(false); SetIconMarginDisabled(false); SetPadding(Padding(0, 0, 0, 0)); _SetScrollBarHidden(true); }
void UWrapBoxSlot::SynchronizeProperties() { SetPadding(Padding); SetFillEmptySpace(bFillEmptySpace); SetFillSpanWhenLessThan(FillSpanWhenLessThan); SetHorizontalAlignment(HorizontalAlignment); SetVerticalAlignment(VerticalAlignment); }
void UBorderSlot::SynchronizeProperties() { if ( Border.IsValid() ) { SetPadding(Padding); SetHorizontalAlignment(HorizontalAlignment); SetVerticalAlignment(VerticalAlignment); } }
CheckButton::CheckButton() : _bChecked(false) , _bAutoSize(true) , _bAdjusted(false) { SetClassName(_T("CheckButton")); SetHorizontalContentAlignment(HoriAlignment::Left); SetPadding(suic::Rect(2,0,0,0)); }
void CContainerUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcscmp(pstrName, _T("inset")) == 0 ) SetInset(CSize(_ttoi(pstrValue), _ttoi(pstrValue))); else if( _tcscmp(pstrName, _T("padding")) == 0 ) SetPadding(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("width")) == 0 ) SetWidth(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("height")) == 0 ) SetHeight(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("scrollbar")) == 0 ) EnableScrollBar(_tcscmp(pstrValue, _T("true")) == 0); else CControlUI::SetAttribute(pstrName, pstrValue); }
void UWindowTitleBarAreaSlot::SynchronizeProperties() { if (WindowTitleBarArea.IsValid()) { SetPadding(Padding); SetHorizontalAlignment(HorizontalAlignment); SetVerticalAlignment(VerticalAlignment); } }
void CChatSelector::SetAllIcons() { CImageList iml; iml.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1); iml.Add(CTempIconLoader(_T("Chat"))); iml.Add(CTempIconLoader(_T("Message"))); iml.Add(CTempIconLoader(_T("MessagePending"))); SetImageList(&iml); m_imlChat.DeleteImageList(); m_imlChat.Attach(iml.Detach()); SetPadding(CSize(12, 3)); }
void CIrcChannelTabCtrl::SetAllIcons() { CImageList imlist; imlist.Create(16, 16, theApp.m_iDfltImageListColorFlags | ILC_MASK, 0, 1); imlist.Add(CTempIconLoader(_T("Chat"))); imlist.Add(CTempIconLoader(_T("Message"))); imlist.Add(CTempIconLoader(_T("MessagePending"))); SetImageList(&imlist); m_imlistIRC.DeleteImageList(); m_imlistIRC.Attach(imlist.Detach()); SetPadding(CSize(10, 3)); }
int COXDockTabCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (COXSkinnedTabCtrl::OnCreate(lpCreateStruct) == -1) return -1; m_font.CreatePointFont(80, _T("MS Sans Serif")); SetFont(&m_font); SetPadding(CSize(12, 4)); return 0; }
void CToolBarCtrlX::AdjustFont(int iMaxPointSize, CSize sizButton) { // The toolbar control uses the font which is specified in the current system // metrics. It does not use the font which is used by the parent. So, if user // switched to "Large Font" mode in Windows System applet, we have to do some // adjustements because our toolbar is of fixed size and designed for 8 pt "MS Shell Dlg". // // This function is only needed when the toolbar control is dynamically created. // If it's created via a dialog resource the font property is handled as // expected even when the font is changed in system applet during runtime. // // -> Avoid to use this function, it most likely creates glitches on some systems. // Toolbar control is very sensitive to font changes, adjust the font // only if really needed. CFont* pFont = GetFont(); if (pFont) { LOGFONT lf = {0}; if (pFont->GetLogFont(&lf) > 0) { HDC hDC = ::GetDC(HWND_DESKTOP); int iPointSize = -MulDiv(lf.lfHeight, 72, GetDeviceCaps(hDC, LOGPIXELSY)); ::ReleaseDC(NULL, hDC); if (iPointSize > iMaxPointSize) { CWnd* pwndParent = GetParent(); ASSERT( pwndParent != NULL ); if (pwndParent) { CFont* pFontDlg = pwndParent->GetFont(); ASSERT( pFontDlg != NULL ); if (pFontDlg) { SetFont(pFontDlg); // Toolbar control likes to resize buttons and stuff // when TBSTYLE_EX_DRAWDDARROWS is applied. if ((GetExtendedStyle() & TBSTYLE_EX_DRAWDDARROWS) != 0) { SetPadding(CSize(0, 0)); SetButtonSize(sizButton); } } } } } } }
TreeViewItem::TreeViewItem() : _showDotLine(false) { SetHorizontalContentAlignment(suic::LEFT); SetVerticalContentAlignment(suic::CENTER); SetPadding(suic::Rect(2,0,0,0)); TreeItemHeader* pHeader = new TreeItemHeader(); _header = pHeader; _check.SetAutoDelete(false); pHeader->SetMinHeight(18); }
Notebook::Notebook(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size, long style) : wxNotebook(parent, id, pos, size, wxNB_DEFAULT) , m_popupWin(NULL) , m_contextMenu(NULL) , m_style(style) , m_notify (true) , m_imgList(NULL) , m_startingTab(Notebook::npos) { Initialize(); SetPadding(wxSize(0, 0)); Connect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxNotebookEventHandler(Notebook::OnIternalPageChanged), NULL, this); Connect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, wxNotebookEventHandler(Notebook::OnIternalPageChanging), NULL, this); Connect(wxEVT_NAVIGATION_KEY, wxNavigationKeyEventHandler(Notebook::OnNavigationKey), NULL, this); Connect(wxEVT_MIDDLE_DOWN, wxMouseEventHandler(Notebook::OnMouseMiddle), NULL, this); Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(Notebook::OnMouseLeftDClick), NULL, this); Connect(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(Notebook::OnMenu), NULL, this); }
void MpButton::Initialize (MpWindow *parent) { SetFrameStyle(Panel|Raised|Enhanced); state = first_expired; // initialize state (first_expired = true) // automatically change shape of button if it is in a pulldown menu if (parent->type == MpGlobal::PulldownMenuType) state |= in_pulldown; // get default for button highlighting if (Mp.GetButtonHighlighting()) state |= highlight; // possible default events for buttons AddEventMask(ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask); // horizontal padding - additional offset from frame SetPadding(4,0); // initially there is no pixmap or bitmap pixmap = 0; bitmap = 0; icon_width = icon_height = 0; // no bitmap mask mask = 0; // auto repeat is disabled // auto-repeat delay is given by MpGlobal::AutoRepeatDelay [ms] // auto-repeat interval is given by MpGlobal::AutoRepeatInterval [ms] // icon alignment: neuther left nor right is set, which means centered // save backgrund color when highlighting saveBackground = 0; // button group link SetGroup(0); }
WebListBox::WebListBox () { miMouseOver = 0; miSelected = 0; mppOption = WEBC_NULL; miNumOptions = 0; mpVScroll = WEBC_NULL; mpHScroll = WEBC_NULL; miSliderWidth = webc_GetDefaultDisplayInt(WEBC_DEFAULT_SLIDER_WIDTH); miTextHeight = miTotalTextHeight = miTotalTextWidth = -1; miLongestOption = 0; mpListener = WEBC_NULL; mStyle = 0; SetFlag(DISPLAY_FLAG_ACCEPTS_FOCUS); SetMargin(LISTBOX_MARGIN); SetPadding(LISTBOX_PADDING); SetBorder(LISTBOX_BORDER); SetSpacing(LISTBOX_SPACING); }
void ItemsControl::OnInitialized() { __super::OnInitialized(); // 加入可视树 AddVisualChild(_scrollHost.get()); AddLogicalChild(_scrollHost.get()); _itemsHost->WriteFlag(CoreFlags::IsComposition, true); _scrollHost->WriteFlag(CoreFlags::IsComposition, true); _scrollHost->BeginInit(); _scrollHost->EndInit(); _scrollHost->SetHorizontalAlignment(HoriAlignment::Stretch); _scrollHost->SetVerticalAlignment(VertAlignment::Stretch); _scrollHost->SetMargin(GetMargin()); _scrollHost->SetFocusable(false); _itemsHost->SetFocusable(false); _itemsHost->SetPadding(GetPadding()); SetPadding(suic::Rect()); }
CTileLayoutUI::CTileLayoutUI() : m_nColumns(2), m_cyNeeded(0) { SetPadding(10); SetInset(CSize(10, 10)); }
*/ void ShowLandInfo(TileIndex tile) { DeleteWindowById(WC_LAND_INFO, 0); new LandInfoWindow(tile); } static const NWidgetPart _nested_about_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_GREY), NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_ABOUT_OPENTTD, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), EndContainer(), NWidget(WWT_PANEL, COLOUR_GREY), SetPIP(4, 2, 4), NWidget(WWT_LABEL, COLOUR_GREY), SetDataTip(STR_ABOUT_ORIGINAL_COPYRIGHT, STR_NULL), NWidget(WWT_LABEL, COLOUR_GREY), SetDataTip(STR_ABOUT_VERSION, STR_NULL), NWidget(WWT_FRAME, COLOUR_GREY), SetPadding(0, 5, 1, 5), NWidget(WWT_EMPTY, INVALID_COLOUR, WID_A_SCROLLING_TEXT), EndContainer(), NWidget(WWT_LABEL, COLOUR_GREY, WID_A_WEBSITE), SetDataTip(STR_BLACK_RAW_STRING, STR_NULL), NWidget(WWT_LABEL, COLOUR_GREY), SetDataTip(STR_ABOUT_COPYRIGHT_OPENTTD, STR_NULL), EndContainer(), }; static const WindowDesc _about_desc( WDP_CENTER, 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, _nested_about_widgets, lengthof(_nested_about_widgets) ); static const char * const _credits[] = {
#include "window_gui.h" #include "widgets/error_widget.h" #include "table/strings.h" #include <list> #include "safeguards.h" static const NWidgetPart _nested_errmsg_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_RED), NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION, STR_NULL), EndContainer(), NWidget(WWT_PANEL, COLOUR_RED), NWidget(WWT_EMPTY, COLOUR_RED, WID_EM_MESSAGE), SetPadding(0, 2, 0, 2), SetMinimalSize(236, 32), EndContainer(), }; static WindowDesc _errmsg_desc( WDP_MANUAL, "error", 0, 0, WC_ERRMSG, WC_NONE, 0, _nested_errmsg_widgets, lengthof(_nested_errmsg_widgets) ); static const NWidgetPart _nested_errmsg_face_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_RED), NWidget(WWT_CAPTION, COLOUR_RED, WID_EM_CAPTION), SetDataTip(STR_ERROR_MESSAGE_CAPTION_OTHER_COMPANY, STR_NULL), EndContainer(),
CTaskPanelUI::CTaskPanelUI() : m_hFadeBitmap(NULL) { SetInset(CSize(8, 8)); SetPadding(10); SetWidth(165); // By default it gets a fixed 165 pixel width }
break; } } } this->SelectOtherObject(-1); } }; static const NWidgetPart _nested_build_object_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_DARK_GREEN), NWidget(WWT_CAPTION, COLOUR_DARK_GREEN), SetDataTip(STR_OBJECT_BUILD_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), NWidget(WWT_DEFSIZEBOX, COLOUR_DARK_GREEN), EndContainer(), NWidget(WWT_PANEL, COLOUR_DARK_GREEN), NWidget(NWID_HORIZONTAL), SetPadding(2, 0, 0, 0), NWidget(NWID_VERTICAL), NWidget(NWID_HORIZONTAL), SetPadding(0, 5, 2, 5), 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),
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), EndContainer(), }; RideSelectGui::RideSelectGui() : GuiWindow(WC_RIDE_SELECT, ALL_WINDOWS_OF_TYPE) { this->SetupWidgetTree(_ride_select_gui_parts, lengthof(_ride_select_gui_parts)); this->SetScrolledWidget(RSEL_LIST, RSEL_SCROLL_LIST); /* Initialize counts of ride kinds */ for (uint i = 0; i < lengthof(this->ride_types); i++) this->ride_types[i] = 0; for (int i = 0; i < MAX_NUMBER_OF_RIDE_TYPES; i++) { const RideType *ride_type = _rides_manager.GetRideType(i); if (ride_type == nullptr) continue;
#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(),
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), NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, ANGRFW_RESCAN), SetMinimalSize(147, 12), SetResize(1, 0), SetDataTip(STR_NEWGRF_ADD_RESCAN_FILES, STR_NEWGRF_ADD_RESCAN_FILES_TOOLTIP),
AIC_WIDGET_CONTENT_DOWNLOAD, ///< Download content button }; /** Widgets for the configure AI window. */ static const NWidgetPart _nested_ai_config_widgets[] = { NWidget(NWID_HORIZONTAL), NWidget(WWT_CLOSEBOX, COLOUR_MAUVE), NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_AI_CONFIG_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), EndContainer(), NWidget(WWT_PANEL, COLOUR_MAUVE, AIC_WIDGET_BACKGROUND), NWidget(NWID_VERTICAL), SetPIP(4, 4, 4), NWidget(NWID_HORIZONTAL), SetPIP(10, 0, 10), NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, AIC_WIDGET_DECREASE), SetFill(0, 1), SetDataTip(AWV_DECREASE, STR_NULL), NWidget(WWT_PUSHARROWBTN, COLOUR_YELLOW, AIC_WIDGET_INCREASE), SetFill(0, 1), SetDataTip(AWV_INCREASE, STR_NULL), NWidget(NWID_SPACER), SetMinimalSize(6, 0), NWidget(WWT_TEXT, COLOUR_MAUVE, AIC_WIDGET_NUMBER), SetDataTip(STR_DIFFICULTY_LEVEL_SETTING_MAXIMUM_NO_COMPETITORS, STR_NULL), SetFill(1, 0), SetPadding(1, 0, 0, 0), EndContainer(), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(10, 0, 10), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_MOVE_UP), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_CONFIG_MOVE_UP, STR_AI_CONFIG_MOVE_UP_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_MOVE_DOWN), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_CONFIG_MOVE_DOWN, STR_AI_CONFIG_MOVE_DOWN_TOOLTIP), EndContainer(), EndContainer(), NWidget(NWID_HORIZONTAL), NWidget(WWT_MATRIX, COLOUR_MAUVE, AIC_WIDGET_LIST), SetMinimalSize(288, 112), SetFill(1, 0), SetDataTip(0x801, STR_AI_CONFIG_LIST_TOOLTIP), SetScrollbar(AIC_WIDGET_SCROLLBAR), NWidget(NWID_VSCROLLBAR, COLOUR_MAUVE, AIC_WIDGET_SCROLLBAR), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(0, 9), NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(5, 0, 5), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CHANGE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CHANGE, STR_AI_CONFIG_CHANGE_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CONFIGURE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_CONFIG_CONFIGURE, STR_AI_CONFIG_CONFIGURE_TOOLTIP), NWidget(WWT_PUSHTXTBTN, COLOUR_YELLOW, AIC_WIDGET_CLOSE), SetFill(1, 0), SetMinimalSize(93, 12), SetDataTip(STR_AI_SETTINGS_CLOSE, STR_NULL),
GIW_HAPPINESS, ///< Happiness level. GIW_ITEMS, ///< List of carried items. GIW_HUNGER_LEVEL, ///< Amount of hunger. GIW_THIRST_LEVEL, ///< Amount of thirst. GIW_WASTE_LEVEL, ///< Amount of food/drink waste. }; /** Widget parts of the #GuestInfoWindow. */ static const WidgetPart _guest_info_gui_parts[] = { Intermediate(0, 1), Intermediate(1, 0), Widget(WT_TITLEBAR, GIW_TITLEBAR, COL_RANGE_DARK_RED), SetData(STR_ARG1, GUI_TITLEBAR_TIP), Widget(WT_CLOSEBOX, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), EndContainer(), Widget(WT_PANEL, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), Intermediate(7, 2), SetPadding(2, 2, 2, 2), Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_MONEY, STR_NULL), Widget(WT_RIGHT_TEXT, GIW_MONEY, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL), Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_MONEY_SPENT, STR_NULL), Widget(WT_RIGHT_TEXT, GIW_MONEY_SPENT, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL), Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_HAPPINESS, STR_NULL), Widget(WT_RIGHT_TEXT, GIW_HAPPINESS, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL), Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_HUNGER, STR_NULL), Widget(WT_RIGHT_TEXT, GIW_HUNGER_LEVEL, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL), Widget(WT_LEFT_TEXT, INVALID_WIDGET_INDEX, COL_RANGE_DARK_RED), SetData(GUI_GUEST_INFO_THIRST, STR_NULL), Widget(WT_RIGHT_TEXT, GIW_THIRST_LEVEL, COL_RANGE_DARK_RED), SetData(STR_ARG1, STR_NULL),
static const int SPR_SW_DIRECTION = SPR_GUI_BUILDARROW_START + EDGE_SW; ///< Sprite for building in SW direction. static const int SPR_NW_DIRECTION = SPR_GUI_BUILDARROW_START + EDGE_NW; ///< Sprite for building in NW direction. /** * Widget parts of the path build GUI. * @ingroup gui_group */ static const WidgetPart _path_build_gui_parts[] = { Intermediate(0, 1), Intermediate(1, 0), Widget(WT_TITLEBAR, INVALID_WIDGET_INDEX, COL_RANGE_GREY), SetData(GUI_PATH_GUI_TITLE, GUI_TITLEBAR_TIP), Widget(WT_CLOSEBOX, INVALID_WIDGET_INDEX, COL_RANGE_GREY), EndContainer(), Widget(WT_PANEL, INVALID_WIDGET_INDEX, COL_RANGE_GREY), Intermediate(0, 1), Intermediate(1, 5), SetPadding(5, 5, 0, 5), Widget(WT_EMPTY, INVALID_WIDGET_INDEX, COL_RANGE_INVALID), SetFill(1, 0), /* Slope down/level/up. */ Widget(WT_IMAGE_BUTTON, PATH_GUI_SLOPE_DOWN, COL_RANGE_GREY), SetData(SPR_GUI_SLOPES_START + TSL_DOWN, GUI_PATH_GUI_SLOPE_DOWN_TIP), Widget(WT_IMAGE_BUTTON, PATH_GUI_SLOPE_FLAT, COL_RANGE_GREY), SetPadding(0, 0, 0, 5), SetData(SPR_GUI_SLOPES_START + TSL_FLAT, GUI_PATH_GUI_SLOPE_FLAT_TIP), Widget(WT_IMAGE_BUTTON, PATH_GUI_SLOPE_UP, COL_RANGE_GREY), SetPadding(0, 0, 0, 5), SetData(SPR_GUI_SLOPES_START + TSL_UP, GUI_PATH_GUI_SLOPE_UP_TIP), Widget(WT_EMPTY, INVALID_WIDGET_INDEX, COL_RANGE_INVALID), SetFill(1, 0), Intermediate(1, 3), SetPadding(5, 5, 0, 5), /* Four arrows direction. */ Intermediate(2, 2), SetHorPIP(0, 2, 5), SetVertPIP(0, 2, 0), Widget(WT_IMAGE_BUTTON, PATH_GUI_NW_DIRECTION, COL_RANGE_GREY), SetData(SPR_NW_DIRECTION, GUI_PATH_GUI_NW_DIRECTION_TIP), Widget(WT_IMAGE_BUTTON, PATH_GUI_NE_DIRECTION, COL_RANGE_GREY),