//***************************************************************************** bool CLevelSelectDialogWidget::Load() //Load resources for the widget. // //Returns: //True if successful, false if not. { this->pPromptLabel = new CLabelWidget(0L, 25, 10, 290, 30, F_Small, wszEmpty); AddWidget(this->pPromptLabel); //OK button gets default focus CButtonWidget *pOKButton = new CButtonWidget( TAG_OK, 100, 205, 60, CY_STANDARD_BUTTON, g_pTheDB->GetMessageText(MID_Okay)); AddWidget(pOKButton); CButtonWidget *pCancelButton = new CButtonWidget( TAG_CANCEL, 170, 205, 60, CY_STANDARD_BUTTON, g_pTheDB->GetMessageText(MID_Cancel)); AddWidget(pCancelButton); this->pLevelListBoxWidget = new CListBoxWidget(TAG_LEVELS_LISTBOX, 15, 45, 300, 130); AddWidget(this->pLevelListBoxWidget); //We're disallowing exits to point to levels in other holds for this release. #ifdef AFTERVERSION1_6 COptionButtonWidget *pAllLevelsOptionButton = new COptionButtonWidget( TAG_ALL_LEVELS_OPTIONBOX, 20, 180, 300, CY_STANDARD_OPTIONBUTTON, g_pTheDB->GetMessageText(MID_ShowAllLevels), false); AddWidget(pAllLevelsOptionButton); #endif return CWidget::Load(); }
SG_BasicCompound::SG_BasicCompound() : SG_Compound(8, 5, 0.1, 0.1) { background = new SG_Panel(SG_COL_FG); okb = new SG_Button("Ok", SG_COL_RAISED, SG_COL_LOW); AddWidget(okb, 7, 4, 1, 1); SG_Widget *labelb = new SG_TextArea("SG_BasicCompound", SG_COL_LOW); AddWidget(labelb, 1, 2, 6, 1); }
SG_ComboBox::SG_ComboBox(const vector<string> &options, bool edit, SimpleTexture btex, SimpleTexture btex_dis, SimpleTexture btex_click, SimpleTexture ttex, SimpleTexture ttex_dis, SimpleTexture ttex_fg, SimpleTexture mtex, SimpleTexture mtex_dis, SimpleTexture mtex_sel) : SG_Compound(binvpro, 1, 0.0, 0.0) { opb = new SG_StickyButton("", btex, btex_dis, btex_click); opb->SetAlignment(SG_ALIGN_CENTER); opb->SetTexturator(stt_dnbutt_up, 0); opb->SetTexturator(stt_dnbutt_dn, 2); AddWidget(opb, binvpro - 1, 0, 1, 1); string message; if (options.size() > 0) message = options[0]; if (edit) text = new SG_Editable(message, ttex, ttex_dis, ttex_fg); else text = new SG_TextArea(message, ttex, ttex_dis); // text->SetVisibleSize(binvpro, 1.0); //FIXME: Don't Lock X Vis Size! AddWidget(text, 0, 0, binvpro - 1, 1); menu = new SG_Menu(options, mtex, mtex_dis, mtex_sel); AddWidget(menu, 0, 0, binvpro, 1); wgeom[2].ypos = 1; wgeom[2].ysize = 1; }
TreeViewWindow::TreeViewWindow() : Window(0, 0, AUTOSIZE, AUTOSIZE) { CppConsUI::TreeView *tree; CppConsUI::TreeView::NodeReference node; CppConsUI::TreeView::NodeReference node2; AddWidget(*(new CppConsUI::Label(20, 1, "Press F10 to quit.")), 1, 1); tree = new CppConsUI::TreeView(30, 12); AddWidget(*tree, 1, 3); SetInputChild(*tree); node = tree->AppendNode(tree->GetRootNode(), *(new CppConsUI::Button("Button node A"))); node2 = tree->AppendNode(node, *(new CppConsUI::Button("Button node A-1"))); tree->AppendNode(node2, *(new CppConsUI::Button("Button node A-1-a"))); tree->AppendNode(node2, *(new CppConsUI::Button("Button node A-1-b"))); tree->AppendNode(node2, *(new CppConsUI::Button("Button node A-1-c"))); tree->AppendNode(node, *(new CppConsUI::Button("Button node A-2"))); tree->AppendNode(node, *(new CppConsUI::Button("Button node A-3"))); node = tree->AppendNode(tree->GetRootNode(), *(new CppConsUI::Label("Label node B"))); tree->AppendNode(node, *(new CppConsUI::Label("Label node B-1"))); tree->AppendNode(node, *(new CppConsUI::Label("Label node B-2"))); tree->AppendNode(node, *(new CppConsUI::Label("Label node B-3"))); node = tree->AppendNode(tree->GetRootNode(), *(new CppConsUI::Button("Button node C"))); tree->AppendNode(node, *(new CppConsUI::Button("Button node C-1"))); tree->AppendNode(node, *(new CppConsUI::Button("Button node C-2"))); tree->AppendNode(node, *(new CppConsUI::Button("Button node C-3"))); }
GuiStateMain::GuiStateMain() { AddWidget( boost::make_shared<Gui::Image>( Rect( Point(0, 0), Editor::GetScreenSizePx() ), boost::make_shared<Texture>( "./_data/backg_main.png" ) )); const Texture::TPtr pBtnTex = boost::make_shared<Texture>( "./_data/button_01.png", 2 ); const Font::TPtr pBtnFont = boost::make_shared<Font>( "./_data/gm.ttf", 20); AddWidget( boost::make_shared<Gui::Label>( Point(Editor::VisibleFieldSizePx().w / 2, 10), boost::make_shared<Font>( "./_data/gm.ttf", 60), "Tag Game", Color::make_white(), Gui::Label::Center )); AddWidget( boost::make_shared<Gui::Label>( Point(Editor::VisibleFieldSizePx().w / 2, Editor::VisibleFieldSizePx().h - 35 ), boost::make_shared<Font>( "./_data/gm.ttf", 30), "mango2d engine demo", Color::make_white(), Gui::Label::Center )); AddWidget( boost::make_shared<Gui::Button>( Rect( Point(Editor::VisibleFieldSizePx().w / 2 - 100, Editor::VisibleFieldSizePx().h / 2), Size(200, 40) ), pBtnFont, pBtnTex, [this](){ GetManager()->SetState( boost::make_shared<GuiStateTest>() ); }, "Start Game" )); }
TeamScrollBox::TeamScrollBox(const std::vector<TeamBox*>& teams, const Point2i &size) : ScrollBox(size) , teams(teams) , count(2) { // SetNbTeams not called immediately AddWidget(teams[0]); AddWidget(teams[1]); }
//***************************************************************************** CEntranceSelectDialogWidget::CEntranceSelectDialogWidget( //Constructor. // //Params: const UINT dwSetTagNo, //(in) Required params for CWidget const int nSetX, const int nSetY) // constructor. : CDialogWidget(dwSetTagNo, nSetX, nSetY, CX_DIALOG, CY_DIALOG, true) //double-click on list box disables , pListBoxWidget(NULL) , pSourceHold(NULL), pCurrentGame(NULL) , pPromptLabel(NULL) { static const UINT CX_SPACE = 15; static const UINT CY_SPACE = 10; static const int Y_LABEL = CY_SPACE; static const UINT CY_LABEL = 60; static const UINT CX_BUTTON = 70; static const int X_OKBUTTON = (CX_DIALOG - 2*CX_BUTTON) / 2; static const int Y_OKBUTTON = CY_DIALOG - CY_STANDARD_BUTTON - CY_SPACE; static const int X_DELETEBUTTON = X_OKBUTTON + CX_BUTTON + 2*CX_SPACE; static const int Y_DELETEBUTTON = Y_OKBUTTON; static const int X_LISTBOX = CX_SPACE; static const int Y_LISTBOX = Y_LABEL + CY_LABEL; static const UINT CX_LISTBOX = CX_DIALOG - X_LISTBOX - CX_SPACE; static const UINT CY_LISTBOX = Y_OKBUTTON - Y_LISTBOX - CY_SPACE; this->pPromptLabel = new CLabelWidget(0L, 0, Y_LABEL, this->w, CY_LABEL, F_Small, wszEmpty); this->pPromptLabel->SetAlign(CLabelWidget::TA_CenterGroup); AddWidget(this->pPromptLabel); //OK button gets default focus CButtonWidget *pButton = new CButtonWidget( TAG_OK, X_OKBUTTON, Y_OKBUTTON, CX_BUTTON, CY_STANDARD_BUTTON, g_pTheDB->GetMessageText(MID_Okay)); AddWidget(pButton); pButton = new CButtonWidget( TAG_DONE, X_OKBUTTON, Y_OKBUTTON, CX_BUTTON, CY_STANDARD_BUTTON, g_pTheDB->GetMessageText(MID_Done)); AddWidget(pButton); pButton->Hide(); pButton = new CButtonWidget( TAG_DELETE, X_DELETEBUTTON, Y_DELETEBUTTON, CX_BUTTON, CY_STANDARD_BUTTON, g_pTheDB->GetMessageText(MID_Delete)); pButton->Hide(); AddWidget(pButton); this->pListBoxWidget = new CListBoxWidget(TAG_ENTRANCES_LISTBOX, X_LISTBOX, Y_LISTBOX, CX_LISTBOX, CY_LISTBOX); AddWidget(this->pListBoxWidget); }
void GMMManageBots::SetupLayout1() { int i, rows, cols; const int max_rows=4; const int label_width = 40; const int start_width = 25; const int stop_width = 25; const int button_spacer = 2; rows = MAX_TEAM_TYPES-1; if(rows > max_rows) rows = max_rows; cols = (MAX_TEAM_TYPES-1)/max_rows; if((MAX_TEAM_TYPES-1)%max_rows) cols++; for(i=NULL_TEAM+1; i<MAX_TEAM_TYPES; i++) { int button_y; int button_x; button_x = GMM_SIDE_MARGIN + ((i-1)/max_rows)*(label_width + button_spacer + start_width + button_spacer + stop_width); button_y = GMM_TITLE_MARGIN + ((i-1)%max_rows)*(GMMWBUTTON_HEIGHT+1); //left { team_label[i].SetText(team_type_string[i]); team_label[i].SetCoords(button_x, button_y + ((GMMWBUTTON_HEIGHT-MMLABEL_HEIGHT)/2)); team_label[i].SetDimensions(label_width, 0); team_label[i].SetJustification(MMLABEL_RIGHT); AddWidget(&team_label[i]); button_x += label_width + button_spacer; start_button[i].SetType(MMGENERIC_BUTTON); start_button[i].SetText("On"); start_button[i].SetCoords(button_x, button_y); start_button[i].SetDimensions(start_width, GMMWBUTTON_HEIGHT); AddWidget(&start_button[i]); button_x += start_width + button_spacer; stop_button[i].SetType(MMGENERIC_BUTTON); stop_button[i].SetText("Off"); stop_button[i].SetCoords(button_x, button_y); stop_button[i].SetDimensions(stop_width, GMMWBUTTON_HEIGHT); AddWidget(&stop_button[i]); button_x += stop_width; } } w = (GMM_SIDE_MARGIN * 2) + cols*(label_width + button_spacer + start_width + button_spacer + stop_width); h = GMM_TITLE_MARGIN + GMM_BOTTOM_MARGIN + (rows)*(GMMWBUTTON_HEIGHT+1); //needed if w is ever changed / set UpdateDimensions(); }
void Open() { SetTitle(settings.GetTitle()); // Every message box is modal for now //settings.IsModeless(); // Icon { cWidget* pWidget = new cImage; cImage::STANDARD_IMAGE image = cImage::STANDARD_INFORMATION; const cMessageBoxSettings::TYPE type = settings.GetType(); if (type == TYPE_INFORMATION) image = cImage::STANDARD_INFORMATION; else if (type == TYPE_WARNING) image = cImage::STANDARD_WARNING; else image = cImage::STANDARD_ERROR; pWidget->SetImage(image); AddWidget(pWidget); } // Static text { cWidget* pWidget = new cStaticText; pWidget->SetText(settings.GetText()); AddWidget(pWidget); } // Yes button { pYesButton = new cDefaultButton; pYesButton->SetText(settings.GetYesButtonText()); AddWidget(pYesButton); } // No button if (settings.HasNoButton()) { ASSERT(pNoButton == nullptr); pNoButton = new cButton; pNoButton->SetText(settings.GetNoButtonText()); AddWidget(pNoButton); } // Cancel button if (settings.HasCancelButton()) { pCancelButton = new cCancelButton; AddWidget(pCancelButton); } }
//***************************************************************************** CDrodFileDialogWidget::CDrodFileDialogWidget( //Constructor. // //Params: const UINT dwSetTagNo, //(in) Required params for CWidget const int nSetX, const int nSetY) // constructor. : CFileDialogWidget(dwSetTagNo, nSetX, nSetY) { static const UINT CX_SPACE = 15; static const UINT CY_SPACE = 8; static const UINT CX_BUTTON = 90; static const int X_BUTTON = CX_FILEDIALOG - CX_BUTTON - CX_SPACE; static const int Y_CANCEL_BUTTON = CY_FILEDIALOG - CY_STANDARD_BUTTON - CY_SPACE * 2; static const int Y_OK_BUTTON = Y_CANCEL_BUTTON - CY_STANDARD_BUTTON - CY_SPACE; #ifdef RUSSIAN_BUILD static const int X_DIR_TEXT_BOX = 110; //move over this->pDirNameTextBox->Move(X_DIR_TEXT_BOX, this->pDirNameTextBox->GetY()); this->pDirNameTextBox->SetWidth(this->pDirNameTextBox->GetW() - (X_DIR_TEXT_BOX - 80)); static const UINT CX_FILENAME = 90; #else static const int X_DIR_TEXT_BOX = 80; //ref from CFileDialogWidget static const UINT CX_FILENAME = 85; #endif static const UINT CX_CURDIR = X_DIR_TEXT_BOX - CX_SPACE; static const UINT CX_FILETYPE = 120; //Add labels (requiring DB text to access). AddWidget(new CLabelWidget(0L, CX_SPACE, 47, CX_CURDIR, 60, F_Small, g_pTheDB->GetMessageText(MID_CurrentDirectory))); AddWidget(new CLabelWidget(0L, CX_SPACE, 570, CX_FILENAME, 30, FONTLIB::F_Small, g_pTheDB->GetMessageText(MID_FileName))); AddWidget(new CLabelWidget(0L, CX_SPACE, 610, CX_FILETYPE, 30, FONTLIB::F_Small, g_pTheDB->GetMessageText(MID_FileType))); //Buttons. CButtonWidget *pOKButton = new CButtonWidget( TAG_OK, X_BUTTON, Y_OK_BUTTON, CX_BUTTON, CY_STANDARD_BUTTON, g_pTheDB->GetMessageText(MID_Okay)); AddWidget(pOKButton); CButtonWidget *pCancelButton = new CButtonWidget( TAG_CANCEL, X_BUTTON, Y_CANCEL_BUTTON, CX_BUTTON, CY_STANDARD_BUTTON, g_pTheDB->GetMessageText(MID_Cancel)); AddWidget(pCancelButton); COptionButtonWidget *pShowHidden = DYN_CAST(COptionButtonWidget*, CWidget*, GetWidget(TAG_SHOW_HIDDEN)); pShowHidden->SetCaption(g_pTheDB->GetMessageText(MID_ShowHiddenFiles)); }
QuitWindow::QuitWindow() : Window ( g_graphics->GetCenterX() - 136, g_graphics->GetCenterY() - 32, 256, 72 ) { SetWidgetClass ( "QuitWindow" ); TextUI *text = new TextUI ( "Are you sure you want to leave ARC++?", false, 23, 16, 245, 9 ); AddWidget ( text ); text = NULL; Button *button = new Button ( (InputCallback)QuitWindow_OnYesClick, this, BUTTON_TYPE_YES, 47, 36 ); m_enterKeyDefault = button; AddWidget ( button ); button = NULL; button = new Button ( (InputCallback)QuitWindow_OnNoClick, this, BUTTON_TYPE_NO, 146, 36 ); AddWidget ( button ); button = NULL; }
CLuaProgressDialog::CLuaProgressDialog(int r) : CBaseLuaProgressDialog(r) { AddWidget(m_pTitle = new NNCurses::CLabel("", false)); AddWidget(m_pProgBar = new NNCurses::CProgressBar(0.0f, 100.0f)); AddWidget(m_pSecTitle = new NNCurses::CLabel("", false)); AddWidget(m_pSecProgBar = new NNCurses::CProgressBar(0.0f, 100.0f)); NNCurses::CBox *bbox = new NNCurses::CBox(NNCurses::CBox::HORIZONTAL, false); AddWidget(bbox); bbox->StartPack(m_pCancelButton = new NNCurses::CButton(GetTranslation("Cancel")), true, false, 0, 0); m_pCancelButton->Enable(false); m_pSecTitle->Enable(false); m_pSecProgBar->Enable(false); }
ErrorWindow::ErrorWindow ( const char *_text, bool _critical ) : Window ( g_graphics->GetCenterX() - 136, g_graphics->GetCenterY() - 44, 256, 72 ), m_critical(_critical) { SetWidgetClass ( "ErrorWindow" ); m_caption = new TextUI ( "[null]", false, 35, 16, 600, 9 ); AddWidget ( m_caption ); Button *button = new Button ( (InputCallback)ErrorWindow_OnOKClick, this, BUTTON_TYPE_OK, (m_position.w / 2) - (58 / 2), 40 ); m_enterKeyDefault = button; AddWidget ( button ); button = NULL; SetCaption ( _text ); }
List::List(Context *context) : Container(context), m_selected(-1) { Context *c = GetContext(); m_container = c->Background(); m_container->SetInnerWidget(c->VBox()); AddWidget(m_container); }
void UIScreenEldBindInputs::CreateCompositeWidget() { UIWidget* const pCompositeWidget = UIFactory::CreateWidget( m_CompositeWidgetDefinitionName, this ); ASSERT( pCompositeWidget ); AddWidget( pCompositeWidget ); }
int Window_( lua_State* L ) { UIWindow* window = new UIWindow; SetName(L, window); SetTopLeftWidthHeight(L, window); SetTooltip(L, window); SetAnim(L, window, UIPanel::NORMAL_ANIM_, "normalAnim"); SetAnim(L, window, UIPanel::DISABLED_ANIM_, "disabledAnim"); SetTextUserData(L, window); AddWidget(L, window); // 配置关闭按钮 if (util::HasField(L, "closeBtn")) { lua_pushstring(L, "closeBtn"); lua_gettable(L, -2); if (lua_istable(L, -1)) SetButton(L, window->GetCloseButton()); lua_pop(L, 1); } SetAlpha(L, window); lua_pushlightuserdata(L, window); return 1; }
void Scene::Initialise() { for(auto it = m_pWidgets.begin(); it != m_pWidgets.end(); ++it) { AddWidget(*it); } }
void ContainerViewGump::init_backpack(std::string datadir, bool extend_area_w) { std::string imagefile, path; uint8 check_y = 27; gump_button = loadButton(datadir, "gump", CHECK_X, check_y); build_path(datadir, "container", path); datadir = path; up_arrow_button = loadButton(datadir, "cont_up", 83, 35); down_arrow_button = loadButton(datadir, "cont_down", 83, 66); build_path(datadir, "backpack_bg.bmp", imagefile); bg_image = SDL_LoadBMP(imagefile.c_str()); doll_button = loadButton(datadir, "cont_doll", area.x + 18, area.y + bg_image->h); left_arrow_button = loadButton(datadir, "cont_left", area.x + 18 + 11, area.y + bg_image->h); right_arrow_button = loadButton(datadir, "cont_right", area.x + 18 + 22, area.y + bg_image->h); SetRect(area.x, area.y, bg_image->w, bg_image->h + 16); //111, 101); container_widget = new ContainerWidgetGump(config, this); container_widget_y_offset = CONTAINER_WIDGET_OFFSET; container_widget->init(actor, 21, container_widget_y_offset, 4, 3, tile_manager, obj_manager, font, CHECK_X, check_y); AddWidget(container_widget); if(extend_area_w) // text extends beyond the gump area.w += 4; }
bool JaRuleFactory::DeviceAdded( WidgetObserver *observer, libusb_device *usb_device, const struct libusb_device_descriptor &descriptor) { if (descriptor.idVendor != VENDOR_ID || descriptor.idProduct != PRODUCT_ID || HasDevice(usb_device)) { return false; } OLA_INFO << "Found a new Ja Rule device"; LibUsbAdaptor::DeviceInformation info; if (!m_adaptor->GetDeviceInfo(usb_device, descriptor, &info)) { return false; } // TODO(simon): Support multiple widgets. if (DeviceCount() > 0) { OLA_WARN << "Only a single Ja Rule device is supported"; return false; } if (FLAGS_use_async_libusb) { return AddWidget(observer, usb_device, new JaRuleWidget(m_ss, m_adaptor, usb_device, m_uid)); } else { OLA_WARN << "Ja Rule devices are not supported in Synchronous mode"; return false; } }
void GfxWidget::Init( unsigned short gfxw, unsigned short gfxh, unsigned short items ) { this->items = items; gfx_w = gfxw; gfx_h = gfxh; gfx_per_row = MAX( bounds.w/gfxw, 1 ); toprow = 0; rows = (items + gfx_per_row - 1) / gfx_per_row * ItemHeight(); visrows = MIN( bounds.h, rows ); current = -1; SliderWidget *slider = static_cast<SliderWidget *>( GetWidget(0) ); if ( slider ) { slider->Adjust( 0, rows - visrows, visrows ); slider->ScrollTo( 0 ); } else { // create the corresponding slider widget slider = new SliderWidget( 0, x + w - DEFAULT_SLIDER_SIZE, y, DEFAULT_SLIDER_SIZE, h, 0, rows - visrows, toprow, visrows, WIDGET_VSCROLL|WIDGET_COMPOSITE, NULL, surface ); slider->SetHook( this ); AddWidget( slider ); } init = true; }
int32 OToolBox :: AddWidget (ODataWidget *pODataWidget, QString qsText ) { int indx0 = 0; indx0 = AddWidget(pODataWidget); SetLabel(indx0, qsText); return indx0; }
Box *Box::PackEnd(Widget *widget) { assert(widget); AddWidget(widget); m_children.push_back(Child(widget)); return this; }
Box *Box::PackStart(Widget *widget) { assert(widget); AddWidget(widget); m_children.push_front(Child(widget)); return this; }
void FMenuBuilder::AddSearchWidget() { MultiBox->SearchTextWidget = SNew(STextBlock) .Visibility( EVisibility::Visible ) .Text( FText::FromString("Search Start") ); AddWidget( MultiBox->SearchTextWidget.ToSharedRef(), FText::GetEmpty(), false, false ); }
Box *Box::PackEnd(Widget *widget, Uint32 flags) { assert(widget); AddWidget(widget); m_children.push_back(Child(widget, flags)); if (flags & BOX_EXPAND) m_countExpanded++; return this; }
BenchItem(BenchType t, const std::string& name, uint height) : HBox(height, false, false, true /* use full height */) , type(t) { Profile *res = GetResourceManager().LoadXMLProfile("graphism.xml", false); bench = new Label(name, 0, Font::FONT_BIG, Font::FONT_BOLD, dark_gray_color, Text::ALIGN_CENTER); AddWidget(bench); score = new Label("N/A", 300, Font::FONT_BIG, Font::FONT_BOLD, primary_red_color, Text::ALIGN_CENTER); AddWidget(score); run = new Button(res, "menu/really_big_plus", true); AddWidget(run); }
BuddyList::BuddyList() : Window(0, 0, 80, 24) { SetColorScheme("buddylist"); CppConsUI::HorizontalListBox *lbox = new CppConsUI::HorizontalListBox(AUTOSIZE, AUTOSIZE); lbox->AppendWidget(*(new CppConsUI::Spacer(1, AUTOSIZE))); treeview = new CppConsUI::TreeView(AUTOSIZE, AUTOSIZE); lbox->AppendWidget(*treeview); lbox->AppendWidget(*(new CppConsUI::Spacer(1, AUTOSIZE))); AddWidget(*lbox, 0, 0); /* TODO Check if this has been moved to purple_blist_init(). Remove these * lines if it was as this will probably move to purple_init(), the * buddylist object should be available a lot more early and the uiops * should be set a lot more early. (All in all a lot of work.) */ buddylist = purple_blist_new(); buddylist->ui_data = this; purple_set_blist(buddylist); // load the pounces purple_pounces_load(); // init prefs purple_prefs_add_none(CONF_PREFIX "/blist"); purple_prefs_add_bool(CONF_PREFIX "/blist/show_empty_groups", false); purple_prefs_add_bool(CONF_PREFIX "/blist/show_offline_buddies", true); purple_prefs_add_string(CONF_PREFIX "/blist/colorization_mode", "none"); UpdateCachedPreference(CONF_PREFIX "/blist/show_empty_groups"); UpdateCachedPreference(CONF_PREFIX "/blist/show_offline_buddies"); UpdateCachedPreference(CONF_PREFIX "/blist/colorization_mode"); // connect callbacks purple_prefs_connect_callback(this, CONF_PREFIX "/blist", blist_pref_change_, this); // setup the callbacks for the buddylist memset(¢erim_blist_ui_ops, 0, sizeof(centerim_blist_ui_ops)); centerim_blist_ui_ops.new_list = new_list_; centerim_blist_ui_ops.new_node = new_node_; //centerim_blist_ui_ops.show = show_; centerim_blist_ui_ops.update = update_; centerim_blist_ui_ops.remove = remove_; centerim_blist_ui_ops.destroy = destroy_; //centerim_blist_ui_ops.set_visible = set_visible_; centerim_blist_ui_ops.request_add_buddy = request_add_buddy_; centerim_blist_ui_ops.request_add_chat = request_add_chat_; centerim_blist_ui_ops.request_add_group = request_add_group_; // since libpurple 2.6.0 //centerim_blist_ui_ops.save_node = save_node_; //centerim_blist_ui_ops.remove_node = remove_node_; //centerim_blist_ui_ops.save_account = save_account_; purple_blist_set_ui_ops(¢erim_blist_ui_ops); COREMANAGER->TimeoutOnceConnect(sigc::mem_fun(this, &BuddyList::Load), 0); }
UCanvasPanelSlot* UGUIDynamicCanvas::AddWidgetAtPosition(UUserWidget* Widget, FVector2D Position, bool bAutoSize, int32 ZOrder) { UCanvasPanelSlot* Slot = AddWidget(Widget, bAutoSize, ZOrder); if (Slot) { Slot->SetPosition(Position); } return Slot; }
Layer *Context::NewLayer() { Layer *layer = new Layer(this); AddWidget(layer); SetWidgetDimensions(layer, Point(0), Point(m_width, m_height)); m_layers.push_back(layer); m_needsLayout = true; return layer; }
CFrontEnd::CFrontEnd() : CGUIMenu() { float width = GameOptions::viewWidth / 2.0f; float height = 50.0f; float xPos = (GameOptions::viewWidth - width) / 2.0f; float yPos = 200.0f; float yOffset = 70.0f; AddWidget(new CButtonWidget(xPos, yPos, width, height, "Play", std::bind(&CFrontEnd::HandlePlayButton, this))); yPos += yOffset; AddWidget(new CButtonWidget(xPos, yPos, width, height, "Video Options", std::bind(&CFrontEnd::HandleVideoOptionsButton, this))); yPos += yOffset; AddWidget(new CButtonWidget(xPos, yPos, width, height, "Input Options", std::bind(&CFrontEnd::HandleInputOptionsButton, this))); yPos += yOffset; AddWidget(new CButtonWidget(xPos, yPos, width, height, "Exit", std::bind(&CFrontEnd::HandleExitButton, this))); yPos += yOffset; }