本文整理汇总了C++中createButtons函数的典型用法代码示例。如果您正苦于以下问题:C++ createButtons函数的具体用法?C++ createButtons怎么用?C++ createButtons使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createButtons函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createButtons
// set the reference chart
void
QTACFunctions::setReferenceChart (void *chart)
{
referencechart = chart;
parentchart = (QTAChart *) chart;
createButtons ();
}
示例2: createButtons
void PhysicsClientExample::initPhysics()
{
if (m_guiHelper && m_guiHelper->getParameterInterface())
{
int upAxis = 2;
m_guiHelper->setUpAxis(upAxis);
createButtons();
} else
{
MyCallback(CMD_LOAD_URDF, true, this);
MyCallback(CMD_STEP_FORWARD_SIMULATION,true,this);
MyCallback(CMD_STEP_FORWARD_SIMULATION,true,this);
MyCallback(CMD_RESET_SIMULATION,true,this);
}
m_selectedBody = -1;
m_prevSelectedBody = -1;
m_physicsClientHandle = b3ConnectSharedMemory(m_sharedMemoryKey);
//m_physicsClientHandle = b3ConnectPhysicsLoopback(SHARED_MEMORY_KEY);
//m_physicsClientHandle = b3ConnectPhysicsDirect();
if (!b3CanSubmitCommand(m_physicsClientHandle))
{
b3Warning("Cannot connect to physics client");
}
}
示例3: createPlayerCount
int Lobby::runScene(){
RenderManager::getRenderManager()->setBackground("Lobby_bg.png");
// number of players in lobby
createPlayerCount();
// creating buttons
createButtons();
createClassButts();
createSlots();
while (true){
updateLobby();
checkButtons();
changePlayerSelectionImage();
// try to start the game if everyone is ready
if (numPlayers == numPlayersReady) {
NetworkManager::sInstance->TryReadyGame();
}
// start the game
if (NetworkManager::sInstance->GetState() >= NetworkManager::NMS_Starting){
removeAllButtons();
SceneManager::GetSceneManager()->AssembleScene();
return SCENE_GAME;
}
}
}
示例4: createButtons
void Sis3350UI::createUI()
{
QGridLayout* l = new QGridLayout;
QGridLayout* boxL = new QGridLayout;
QGroupBox* box = new QGroupBox;
box->setTitle(name + " Settings");
// Module specific code here
QWidget* buttons = createButtons();
QWidget* tabs = createTabs();
boxL->addWidget(buttons,0,0,1,1);
boxL->addWidget(tabs,1,0,1,1);
viewport = new Viewport(0,module->rblt_data,4,module->conf.sample_length);
viewport->setWindowTitle(tr("sis3350 Preview"));
// End
l->addWidget(box,0,0,1,1);
box->setLayout(boxL);
this->setLayout(l);
}
示例5: _widget
ParticleEditor::ParticleEditor () :
_widget(gtk_window_new(GTK_WINDOW_TOPLEVEL))
{
// Window properties
gtk_window_set_transient_for(GTK_WINDOW(_widget), GlobalRadiant().getMainWindow());
gtk_window_set_modal(GTK_WINDOW(_widget), TRUE);
gtk_window_set_title(GTK_WINDOW(_widget), PARTICLEEDITOR_TITLE);
gtk_window_set_position(GTK_WINDOW(_widget), GTK_WIN_POS_CENTER_ON_PARENT);
// Set the default size of the window
GdkScreen* scr = gtk_window_get_screen(GTK_WINDOW(_widget));
gint w = gdk_screen_get_width(scr);
gint h = gdk_screen_get_height(scr);
gtk_window_set_default_size(GTK_WINDOW(_widget), gint(w * 0.75), gint(h * 0.8));
// Create the model preview widget
gint glSize = gint(h * 0.4);
_particlePreview.setSize(glSize);
// Signals
//g_signal_connect(G_OBJECT(_widget), "delete_event", G_CALLBACK(callbackHide), this);
// Main window contains a VBox
GtkWidget* vbx = gtk_vbox_new(FALSE, 3);
gtk_box_pack_start(GTK_BOX(vbx), createPreviewPanel(), FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbx), createButtons(), FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(_widget), vbx);
}
示例6: QDialog
DiagnoseBrowser::DiagnoseBrowser(QWidget* parent) : QDialog(parent)
{
diagnoseModel = new QSqlTableModel(this);
diagnoseModel->setTable("diagnoses");
diagnoseModel->setSort(DiagnoseName, Qt::AscendingOrder);
diagnoseModel->select();
diagnoseView = new QTableView();
diagnoseView->setModel(diagnoseModel);
diagnoseView->setSelectionMode(QAbstractItemView::SingleSelection);
diagnoseView->setSelectionBehavior(QAbstractItemView::SelectRows);
diagnoseView->setShowGrid(false);
diagnoseView->horizontalHeader()->setStretchLastSection(true);
createButtons();
QHBoxLayout* buttonLayout = new QHBoxLayout();
buttonLayout->addWidget(newButton);
buttonLayout->addWidget(deleteButton);
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget(diagnoseView);
layout->addLayout(buttonLayout);
setLayout(layout);
setFixedHeight(sizeHint().height());
setWindowTitle(tr("Diagnosen Browser"));
connect(newButton, SIGNAL(clicked()), this, SLOT(newDiagnose()));
connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteDiagnose()));
}
示例7: _widget
LightDialog::LightDialog () :
_widget(gtk_window_new(GTK_WINDOW_TOPLEVEL)), _aborted(false)
{
// Set up the window
gtk_window_set_transient_for(GTK_WINDOW(_widget), GlobalRadiant().getMainWindow());
gtk_window_set_modal(GTK_WINDOW(_widget), TRUE);
gtk_window_set_title(GTK_WINDOW(_widget), _("Create light entity"));
gtk_window_set_position(GTK_WINDOW(_widget), GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_type_hint(GTK_WINDOW(_widget), GDK_WINDOW_TYPE_HINT_DIALOG);
// Set the default size of the window
gtk_window_set_default_size(GTK_WINDOW(_widget), 300, 300);
// Delete event
g_signal_connect(
G_OBJECT(_widget), "delete-event", G_CALLBACK(_onDelete), this
);
// Main vbox
GtkWidget* vbx = gtk_vbox_new(FALSE, 12);
gtk_box_pack_start(GTK_BOX(vbx), gtkutil::FramedWidget(createColorSelector(), _("Light Color")), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbx), gtkutil::FramedWidget(createIntensity(), _("Light Intensity")), FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbx), createButtons(), FALSE, FALSE, 0);
gtk_container_set_border_width(GTK_CONTAINER(_widget), 12);
gtk_container_add(GTK_CONTAINER(_widget), vbx);
_intensityEntry.setValue(_defaultIntensity);
}
示例8: add
void ConversationDialog::populateWindow()
{
// Create the overall vbox
_dialogVBox = Gtk::manage(new Gtk::VBox(false, 12));
add(*_dialogVBox);
_dialogVBox->pack_start(
*Gtk::manage(new gtkutil::LeftAlignedLabel(std::string("<b>") + _("Conversation entities") + "</b>")),
false, false, 0);
_dialogVBox->pack_start(
*Gtk::manage(new gtkutil::LeftAlignment(createEntitiesPanel(), 18, 1.0)),
false, false, 0);
_dialogVBox->pack_start(
*Gtk::manage(new gtkutil::LeftAlignedLabel(std::string("<b>") + _("Conversations") + "</b>")),
false, false, 0);
_dialogVBox->pack_start(
*Gtk::manage(new gtkutil::LeftAlignment(createConversationsPanel(), 18, 1.0)),
true, true, 0);
// Pack in dialog buttons
_dialogVBox->pack_start(createButtons(), false, false, 0);
}
示例9: createButton
void ActionChoiceWindow::createButtons(
ActionNode* actions, const CEGUI::Point& center,
float radius, float angle, float angleWidth)
{
PushButton* button = NULL;
if (actions->isLeaf())
{
button = createButton(actions->getAction()->getName(), center);
}
else
{
if (actions->getGroup() != NULL)
{
button = createButton(actions->getGroup()->getName(), center);
}
const NodeSet children = actions->getChildren();
float angleStep = angleWidth / (float)children.size();
float ang = children.size()>1 ? angle - angleWidth : angle - 180;
for (NodeSet::const_iterator iter = children.begin();
iter != children.end(); iter++)
{
CEGUI::Point centerChild = getPositionOnCircle(center, radius, ang);
createButtons(*iter, centerChild, radius, ang, 60);
ang += angleStep;
}
}
actions->setButton(button);
if (button != NULL)
mWindow->addChildWindow(button);
}
示例10: _targetEntry
// Construct the dialog
ShaderChooser::ShaderChooser(wxWindow* parent, wxTextCtrl* targetEntry) :
wxutil::DialogBase(_(LABEL_TITLE), parent),
_targetEntry(targetEntry),
_selector(NULL)
{
// Create a default panel to this dialog
wxPanel* mainPanel = new wxPanel(this, wxID_ANY);
mainPanel->SetSizer(new wxBoxSizer(wxVERTICAL));
wxBoxSizer* dialogVBox = new wxBoxSizer(wxVERTICAL);
mainPanel->GetSizer()->Add(dialogVBox, 1, wxEXPAND | wxALL, 12);
_selector = new ShaderSelector(mainPanel, this, SHADER_PREFIXES);
if (_targetEntry != NULL)
{
_initialShader = targetEntry->GetValue();
// Set the cursor of the tree view to the currently selected shader
_selector->setSelection(_initialShader);
}
// Pack in the ShaderSelector and buttons panel
dialogVBox->Add(_selector, 1, wxEXPAND);
createButtons(mainPanel, dialogVBox);
// Connect the window position tracker
_windowPosition.loadFromPath(RKEY_WINDOW_STATE);
_windowPosition.connect(this);
_windowPosition.applyPosition();
}
示例11: createButtons
void PhysicsClientExample::initPhysics()
{
if (m_guiHelper && m_guiHelper->getParameterInterface())
{
int upAxis = 2;
m_guiHelper->setUpAxis(upAxis);
createButtons();
} else
{
/*
m_userCommandRequests.push_back(CMD_LOAD_URDF);
m_userCommandRequests.push_back(CMD_REQUEST_ACTUAL_STATE);
m_userCommandRequests.push_back(CMD_SEND_DESIRED_STATE);
m_userCommandRequests.push_back(CMD_REQUEST_ACTUAL_STATE);
//m_userCommandRequests.push_back(CMD_SET_JOINT_FEEDBACK);
m_userCommandRequests.push_back(CMD_CREATE_BOX_COLLISION_SHAPE);
//m_userCommandRequests.push_back(CMD_CREATE_RIGID_BODY);
m_userCommandRequests.push_back(CMD_STEP_FORWARD_SIMULATION);
m_userCommandRequests.push_back(CMD_REQUEST_ACTUAL_STATE);
m_userCommandRequests.push_back(CMD_SHUTDOWN);
*/
}
if (!m_physicsClient.connect())
{
b3Warning("Cannot connect to physics client");
}
}
示例12: _widget
ModelSelector::ModelSelector () :
_widget(gtk_window_new(GTK_WINDOW_TOPLEVEL)), _treeStore(gtk_tree_store_new(N_COLUMNS, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, GDK_TYPE_PIXBUF)), _infoStore(gtk_list_store_new(2,
G_TYPE_STRING, G_TYPE_STRING)), _lastModel(""), _lastSkin(-1)
{
// Window properties
gtk_window_set_transient_for(GTK_WINDOW(_widget), GlobalRadiant().getMainWindow());
gtk_window_set_modal(GTK_WINDOW(_widget), TRUE);
gtk_window_set_title(GTK_WINDOW(_widget), MODELSELECTOR_TITLE);
gtk_window_set_position(GTK_WINDOW(_widget), GTK_WIN_POS_CENTER_ON_PARENT);
// Set the default size of the window
GtkWindow* mainWindow = GlobalRadiant().getMainWindow();
gint w;
gint h;
gtk_window_get_size(mainWindow,&w,&h);
gtk_window_set_default_size(GTK_WINDOW(_widget), gint(w * 0.75), gint(h * 0.8));
// Create the model preview widget
float previewHeightFactor = GlobalRegistry().getFloat("user/ui/ModelSelector/previewSizeFactor");
gint glSize = gint(h * previewHeightFactor);
_modelPreview.setSize(glSize);
// Signals
g_signal_connect(G_OBJECT(_widget), "delete_event", G_CALLBACK(callbackHide), this);
// Main window contains a VBox
GtkWidget* vbx = gtk_vbox_new(FALSE, 3);
gtk_box_pack_start(GTK_BOX(vbx), createTreeView(), TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbx), createPreviewAndInfoPanel(), FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbx), createButtons(), FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(_widget), vbx);
}
示例13: _targetEntry
// Construct the dialog
ShaderChooser::ShaderChooser(const Glib::RefPtr<Gtk::Window>& parent,
Gtk::Entry* targetEntry) :
gtkutil::BlockingTransientWindow(_(LABEL_TITLE), parent),
_targetEntry(targetEntry),
_selector(Gtk::manage(new ShaderSelector(this, SHADER_PREFIXES)))
{
set_border_width(12);
if (_targetEntry != NULL)
{
_initialShader = targetEntry->get_text();
// Set the cursor of the tree view to the currently selected shader
_selector->setSelection(_initialShader);
}
// Set the default size and position of the window
set_default_size(DEFAULT_SIZE_X, DEFAULT_SIZE_Y);
// Connect the key handler to catch the ESC event
signal_key_press_event().connect(sigc::mem_fun(*this, &ShaderChooser::onKeyPress), false);
// Construct main VBox, and pack in the ShaderSelector and buttons panel
Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 3));
vbx->pack_start(*_selector, true, true, 0);
vbx->pack_start(createButtons(), false, false, 0);
add(*vbx);
// Connect the window position tracker
_windowPosition.loadFromPath(RKEY_WINDOW_STATE);
_windowPosition.connect(this);
_windowPosition.applyPosition();
}
示例14: GlobalMainFrame
// Construct the dialog
LightTextureChooser::LightTextureChooser()
: gtkutil::BlockingTransientWindow(_("Choose texture"), GlobalMainFrame().getTopLevelWindow()),
_selector(Gtk::manage(new ShaderSelector(this, getPrefixList(), true))) // true >> render a light texture
{
// Set the default size of the window
Gdk::Rectangle rect;
if (GlobalGroupDialog().getDialogWindow()->is_visible())
{
rect = gtkutil::MultiMonitor::getMonitorForWindow(GlobalGroupDialog().getDialogWindow());
}
else
{
rect = gtkutil::MultiMonitor::getMonitorForWindow(GlobalMainFrame().getTopLevelWindow());
}
set_default_size(static_cast<int>(rect.get_width()*0.6f), static_cast<int>(rect.get_height()*0.6f));
// Construct main VBox, and pack in ShaderSelector and buttons panel
Gtk::VBox* vbx = Gtk::manage(new Gtk::VBox(false, 6));
vbx->pack_start(*_selector, true, true, 0);
vbx->pack_start(createButtons(), false, false, 0);
add(*vbx);
}
示例15: BaseToolBarControl
ItemToolBarControl::ItemToolBarControl(wxWindow* parent) : BaseToolBarControl(parent)
{
m_butExpand = new gcImageButton(this, BUTTON_EXPAND, wxDefaultPosition, wxSize( 19,19 ), 0 );
m_butExpand->setDefaultImage(("#items_expand"));
m_butExpand->setHoverImage(("#items_expand_hover"));
m_butExpand->SetToolTip(Managers::GetString(L"#DM_EXPAND"));
m_butContract = new gcImageButton(this, BUTTON_CONTRACT, wxDefaultPosition, wxSize( 19,19 ), 0 );
m_butContract->setDefaultImage(("#items_contract"));
m_butContract->setHoverImage(("#items_contract_hover"));
m_butContract->SetToolTip(Managers::GetString(L"#DM_CONTRACT"));
#ifdef ENABLE_SEARCH
m_pSearch = new SearchControl(this);
m_pSearch->onSearchEvent += delegate(&onSearchEvent);
m_pSearch->onFullSearchEvent += delegate(&onSearchEvent);
#else
m_pSearch = nullptr;
#endif
m_pFGContentSizer = new wxFlexGridSizer( 1, 10, 0, 0 );
m_pFGContentSizer->AddGrowableRow( 0 );
m_pFGContentSizer->SetFlexibleDirection( wxBOTH );
m_pFGContentSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
createButtons();
wxFlexGridSizer* fgSizer1;
fgSizer1 = new wxFlexGridSizer( 1, 6, 0, 0 );
fgSizer1->AddGrowableCol( 1 );
fgSizer1->AddGrowableRow( 0 );
fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
fgSizer1->Add( m_pFGContentSizer, 0, 0, 4 );
fgSizer1->Add( 3, 0, 1, 0, 4 );
fgSizer1->Add( m_butExpand, 0, wxTOP|wxBOTTOM, 4 );
#ifdef ENABLE_SEARCH
fgSizer1->Add( m_butContract, 0, wxTOP|wxBOTTOM, 4 );
fgSizer1->Add( m_pSearch, 0, wxTOP|wxBOTTOM, 4);
fgSizer1->Add( m_pSearch->getButton(), 0, wxTOP|wxBOTTOM|wxRIGHT, 4);
#else
fgSizer1->Add( m_butContract, 0, wxTOP|wxBOTTOM|wxRIGHT, 4 );
#endif
this->SetSizer( fgSizer1 );
this->Layout();
auto userCore = GetUserCore();
if (userCore && GetUploadMng())
{
userCore->getItemsAddedEvent() += guiDelegate(this, &ItemToolBarControl::onItemsAdded);
userCore->getLoginItemsLoadedEvent() += guiDelegate(this, &ItemToolBarControl::onLoginItemsLoaded);
GetUploadMng()->getUpdateEvent() += guiDelegate(this, &ItemToolBarControl::onUploadItemsAdded);
}
}