本文整理汇总了C++中CheckButton类的典型用法代码示例。如果您正苦于以下问题:C++ CheckButton类的具体用法?C++ CheckButton怎么用?C++ CheckButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CheckButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCheckButtonChecked
void CVGUIGstringOptions::OnCheckButtonChecked( Panel *panel )
{
CheckButton *pCheckButton = dynamic_cast< CheckButton* >( panel );
if ( pCheckButton != NULL )
{
bool value = pCheckButton->IsSelected();
CheckButton *checkButtons[ PP_CHECKS ] = {
m_pCheck_HurtFX,
m_pCheck_GodRays,
m_pCheck_WaterEffects,
m_pCheck_Vignette,
m_pCheck_LensFlare,
m_pCheck_DreamBlur,
m_pCheck_ScreenBlur,
m_pCheck_CinemaOverlay
};
for ( int i = 0; i < PP_CHECKS; ++i )
{
if ( checkButtons[ i ] == panel )
{
m_state.checks[ i ] = value;
}
}
}
OnPresetModified();
}
示例2: PHYSFS_enumerateFiles
void MainMenu::fillLoadMenu( bool save /*= false*/ )
{
const std::string buttonNames[]={"File0","File1","File2","File3","File4","File5"};
char** rc = PHYSFS_enumerateFiles("/");
char* curfile;
CheckButton *button;
for(int i=0;i<6;i++) {
char* recentfile = NULL;
PHYSFS_sint64 t = 0;
std::stringstream filestart;
filestart << i+1 << "_";
if( save ){
button = getCheckButton(*saveGameMenu.get(),buttonNames[i]);
} else {
button = getCheckButton(*loadGameMenu.get(),buttonNames[i]);
}
//make sure Button is connected only once
button->clicked.clear();
if( save )
button->clicked.connect(makeCallback(*this,&MainMenu::selectSaveGameButtonClicked));
else {
button->clicked.connect(makeCallback(*this,&MainMenu::selectLoadGameButtonClicked));
}
for(char** i = rc; *i != 0; i++){
curfile = *i;
if(std::string( curfile ).find( filestart.str() ) == 0 ) {
// && !( curfile->d_type & DT_DIR ) ) is not portable. So
// don't create a directoy named 2_ in a savegame-directory or
// you can no longer load from slot 2.
if (t == 0) {
recentfile = curfile;
t = PHYSFS_getLastModTime(recentfile);
} else {
if (PHYSFS_getLastModTime(curfile) > t) {
/*#ifdef DEBUG
fprintf(stderr," %s is more recent than previous %s\n",
curfile, recentfile);
#endif*/
recentfile = curfile;
t = PHYSFS_getLastModTime(recentfile);
}
}
}
}
#ifdef DEBUG
fprintf(stderr,"Most recent file: %s\n\n",recentfile);
#endif
if(t != 0) {
std::string f= recentfile;
button->setCaptionText(f);
} else {
button->setCaptionText(_("empty"));
}
}
}
示例3: IsIPCheck
bool CDialogAddBan::IsIPCheck()
{
CheckButton *entry = dynamic_cast<CheckButton *>(FindChildByName("IPCheck"));
if (entry)
{
return entry->IsSelected();
}
return false;
}
示例4:
result
CheckButtonForm::OnInitializing(void)
{
BaseForm::OnInitializing();
result r = E_SUCCESS;
CheckButton* pCheckButton = static_cast <CheckButton*> (GetControl("IDC_CHECKBUTTON_DISABLE", true));
pCheckButton->SetEnabled(false);
return r;
}
示例5: SetFormBackEventListener
result Enrollment::OnInitializing(void) {
result r = E_SUCCESS;
CheckButton* pCheckBtn = null;
SetFormBackEventListener(this);
__pSaveBtn = static_cast<Button*>(GetControl(IDC_SAVE));
__pDate = static_cast<Label*>(GetControl(IDC_DATE));
String cBtnName[] = { IDC_CHECKBUTTON_WORK1, IDC_CHECKBUTTON_WORK2,
IDC_CHECKBUTTON_WORK3, IDC_CHECKBUTTON_WORK4 };
for (int i = 0; i < MAX_WORK_COUNT; i++) {
__pWorkList[i] = static_cast<CheckButton*>(GetControl(cBtnName[i]));
}
for (int i = 0; i < MAX_WORK_COUNT; i++) {
pCheckBtn = dynamic_cast<CheckButton*>(GetControl(cBtnName[i]));
TryReturn(pCheckBtn != null, E_SYSTEM,
"Unable to get control [%ls]", cBtnName[i].GetPointer());
pCheckBtn->SetEnabled(false);
pCheckBtn->SetActionId(ID_WORK_1 + i, ID_WORK_1 + 500 + i);
pCheckBtn->AddActionEventListener(*this);
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!
String btnName[] = { IDC_PILL_1, IDC_PILL_2, IDC_PILL_3, IDC_MEET, IDC_SAVE,
IDC_DEL };
Button* pButton = null;
for (int i = 0; i < MAX_BTN_COUNT; i++) {
pButton = dynamic_cast<Button*>(GetControl(btnName[i]));
TryReturn(pButton != null, E_SYSTEM,
"Unable to get control [%ls]", btnName[i].GetPointer());
pButton->SetActionId(IDC_BUTTON_PILL_1 + i);
pButton->AddActionEventListener(*this);
}
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!
__pForm = this;
EnableControl(false);
return r;
}
示例6: switch
void
options::transport_callback (button a_type, Button * a_check)
{
CheckButton *check = (CheckButton *) a_check;
switch (a_type)
{
case e_jack_transport:
{
global_with_jack_transport = check->get_active ();
}
break;
case e_jack_master:
{
global_with_jack_master = check->get_active ();
}
break;
case e_jack_master_cond:
{
global_with_jack_master_cond = check->get_active ();
}
break;
case e_jack_connect:
{
m_perf->init_jack ();
}
break;
case e_jack_disconnect:
{
m_perf->deinit_jack ();
}
break;
default:
break;
}
}
示例7: iter
void DClusterSetManagerPage::handleDevClusterAuthorizedInfo(InputPacket& inpack)
{
quint8 ansCode = inpack.getAnswerCode();
if(clusterAddManagerPage != NULL){
clusterAddManagerPage->fetchData(inpack);
if(ansCode == Mi::Success){//添加管理员成功
quint64 managerID = clusterAddManagerPage->getManagerID();
QHash<quint64, DClusterUserInfo*> infoList = userInfoList->fetchList();
QHashIterator<quint64, DClusterUserInfo*> iter(infoList);
while(iter.hasNext())
{
iter.next();
DClusterUserInfo* userInfo = dynamic_cast<DClusterUserInfo*>(iter.value());
if(managerID == userInfo->getUserID()){
userInfo->setUserRole(Mi::SeniorManager);
this->appendManagerToList(userInfo);
return;
}
}
}
return;
}
QString strText;
if(ansCode == Mi::Success){
strText = tr("取消管理员成功");
QHashIterator<quint64, CheckButton*> iter(btnCheckList);
while(iter.hasNext())
{
iter.next();
CheckButton* btn = iter.value();
if(btn->getUserID() == curCancelManagerID){
managerLayout->removeWidget(btn);
SAFE_DELETE(btn);
}
}
}
else if(ansCode == Mi::Failure)
strText = tr("取消管理员失败, 请重试");
this->handleHintInfo(strText);
}
示例8: GetPPCache
void CDialog_PPEPrecache::FillList()
{
ScrollBar *pScroll = m_pList_Effects->GetScrollbar();
int scrollValue = pScroll ? pScroll->GetValue() : 0;
m_pList_Effects->DeleteAllItems();
GetPPCache()->ClearInvalidEntries();
HFont fontMarlett = scheme()->GetIScheme( GetScheme() )->GetFont( "Marlett", false );
for ( int i = 0; i < GetPPCache()->GetNumPostProcessingEffects(); i++ )
{
EditorPostProcessingEffect *effect = GetPPCache()->GetPostProcessingEffect( i );
Label *pL = new Label( m_pList_Effects, "", effect->pszName );
Button *pDel = new Button( m_pList_Effects, "", "Delete", this, VarArgs("del_effect_%i",i) );
CheckButton *pCheck = new CheckButton( m_pList_Effects, effect->pszName, "" );
pCheck->AddActionSignalTarget( this );
pCheck->SetSelected( effect->bStartEnabled );
Button *pDown = new Button( m_pList_Effects, "", "u", this, VarArgs("movedown_effect_%i",i) );
Button *pUp = new Button( m_pList_Effects, "", "t", this, VarArgs("moveup_effect_%i",i) );
pDown->SetFont( fontMarlett );
pUp->SetFont( fontMarlett );
pDel->SetContentAlignment( Label::a_center );
pDown->SetContentAlignment( Label::a_center );
pUp->SetContentAlignment( Label::a_center );
m_pList_Effects->AddItem( NULL, pCheck );
m_pList_Effects->AddItem( NULL, pDown );
m_pList_Effects->AddItem( NULL, pUp );
m_pList_Effects->AddItem( pL, pDel );
}
if ( pScroll )
pScroll->SetValue( scrollValue );
}
示例9: manage
/*MIDI Input page*/
void
options::add_midi_input_page()
{
// Input Buses
int buses = m_perf->get_master_midi_bus ()->get_num_in_buses ();
VBox *vbox = manage(new VBox ());
vbox->set_border_width(6);
m_notebook->append_page(*vbox, "MIDI _Input", true);
for (int i = 0; i < buses; i++)
{
CheckButton *check = manage(new CheckButton(
m_perf->get_master_midi_bus()->get_midi_in_bus_name(i), 0));
check->signal_toggled().connect(bind(mem_fun(*this,
&options::input_callback), i, check));
check->set_active(m_perf->get_master_midi_bus()->get_input(i));
vbox->pack_start(*check, false, false);
}
}
示例10: on_btnCancelManager_clicked
void DClusterSetManagerPage::on_btnCancelManager_clicked()
{
CheckButton* btn = dynamic_cast<CheckButton*>(sender());
btn->setReviewText(tr("取消管理员"));
quint8 role = Mi::Operator;
curCancelManagerID = btn->getUserID();
AssemblyData assemblyData;
assemblyData.append(curClusterID);
assemblyData.append(role);
assemblyData.append(curCancelManagerID);
char* data = assemblyData.getAssemblyData();
quint16 dataLen = assemblyData.getAssemblyDataLen();
emit readyRead(CommandCode::DCLUSTER_SETTING_USER_AUTHORIZE, data, dataLen);
//页面加载窗口
if(loadingPage == NULL){
loadingPage = new LoadingPage(this);
loadingPage->show();
}
}
示例11: switch
void
options::transport_callback(button a_type, Button *a_check)
{
CheckButton *check = (CheckButton *) a_check;
switch (a_type)
{
case e_jack_transport:
global_with_jack_transport = check->get_active();
break;
case e_jack_master:
global_with_jack_master = check->get_active();
break;
case e_jack_master_cond:
global_with_jack_master_cond = check->get_active();
break;
default:
break;
}
}
示例12: AddButton
//==== Create & Init Gui CheckButton ====//
void GroupLayout::AddButton( CheckButton& cbutton, const char* label )
{
assert( m_Group && m_Screen );
//==== Add Check Button ====//
int bw = FitWidth( 0, m_ButtonWidth );
Fl_Check_Button* flbutton = new Fl_Check_Button( m_X, m_Y, bw, m_StdHeight, label );
flbutton->box( FL_DOWN_BOX );
flbutton->down_box( FL_DOWN_BOX );
flbutton->labelfont( 1 );
flbutton->labelsize( 12 );
flbutton->labelcolor( FL_DARK_BLUE );
flbutton->copy_label( label );
m_Group->add( flbutton );
AddX( bw );
AddY( m_StdHeight );
NewLineX();
cbutton.Init( m_Screen, flbutton );
}
示例13: while
//-----------------------------------------------------------------------------
// Purpose: Creates all the controls in the game options list
//-----------------------------------------------------------------------------
void CCreateMultiplayerGameGameplayPage::LoadGameOptionsList()
{
// destroy any existing controls
mpcontrol_t *p, *n;
p = m_pList;
while ( p )
{
n = p->next;
//
delete p->pControl;
delete p->pPrompt;
delete p;
p = n;
}
m_pList = NULL;
// Go through desciption creating controls
CScriptObject *pObj;
pObj = m_pDescription->pObjList;
mpcontrol_t *pCtrl;
CheckButton *pBox;
TextEntry *pEdit;
ComboBox *pCombo;
CScriptListItem *pListItem;
Panel *objParent = m_pOptionsList;
while ( pObj )
{
pCtrl = new mpcontrol_t( objParent, "mpcontrol_t" );
pCtrl->type = pObj->type;
switch ( pCtrl->type )
{
case O_BOOL:
pBox = new CheckButton( pCtrl, "DescCheckButton", pObj->prompt );
pBox->SetSelected( pObj->fdefValue != 0.0f ? true : false );
pCtrl->pControl = (Panel *)pBox;
break;
case O_STRING:
case O_NUMBER:
pEdit = new TextEntry( pCtrl, "DescTextEntry");
pEdit->InsertString(pObj->defValue);
pCtrl->pControl = (Panel *)pEdit;
break;
case O_LIST:
pCombo = new ComboBox( pCtrl, "DescComboBox", 5, false );
pListItem = pObj->pListItems;
while ( pListItem )
{
pCombo->AddItem(pListItem->szItemText, NULL);
pListItem = pListItem->pNext;
}
pCombo->ActivateItemByRow((int)pObj->fdefValue);
pCtrl->pControl = (Panel *)pCombo;
break;
default:
break;
}
if ( pCtrl->type != O_BOOL )
{
pCtrl->pPrompt = new vgui::Label( pCtrl, "DescLabel", "" );
pCtrl->pPrompt->SetContentAlignment( vgui::Label::a_west );
pCtrl->pPrompt->SetTextInset( 5, 0 );
pCtrl->pPrompt->SetText( pObj->prompt );
}
pCtrl->pScrObj = pObj;
pCtrl->SetSize( 100, 28 );
//pCtrl->SetBorder( scheme()->GetBorder(1, "DepressedButtonBorder") );
m_pOptionsList->AddItem( pCtrl );
// Link it in
if ( !m_pList )
{
m_pList = pCtrl;
pCtrl->next = NULL;
}
else
{
mpcontrol_t *p;
p = m_pList;
while ( p )
{
if ( !p->next )
{
//.........这里部分代码省略.........
示例14: EditorTranslationImportDialog
EditorTranslationImportDialog(EditorTranslationImportPlugin *p_plugin) {
plugin=p_plugin;
set_title(TTR("Import Translation"));
VBoxContainer *vbc = memnew( VBoxContainer );
add_child(vbc);
set_child_rect(vbc);
VBoxContainer *csvb = memnew( VBoxContainer );
HBoxContainer *hbc = memnew( HBoxContainer );
csvb->add_child(hbc);
vbc->add_margin_child(TTR("Source CSV:"),csvb);
import_path = memnew( LineEdit );
import_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(import_path);
ignore_first = memnew( CheckButton );
ignore_first->set_text(TTR("Ignore First Row"));
csvb->add_child(ignore_first);
Button * import_choose = memnew( Button );
import_choose->set_text(" .. ");
hbc->add_child(import_choose);
import_choose->connect("pressed", this,"_browse");
VBoxContainer *tcomp = memnew( VBoxContainer);
hbc = memnew( HBoxContainer );
tcomp->add_child(hbc);
vbc->add_margin_child(TTR("Target Path:"),tcomp);
save_path = memnew( LineEdit );
save_path->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(save_path);
Button * save_choose = memnew( Button );
save_choose->set_text(" .. ");
hbc->add_child(save_choose);
save_choose->connect("pressed", this,"_browse_target");
compress = memnew( CheckButton);
compress->set_pressed(true);
compress->set_text(TTR("Compress"));
tcomp->add_child(compress);
add_to_project = memnew( CheckButton);
add_to_project->set_pressed(true);
add_to_project->set_text(TTR("Add to Project (engine.cfg)"));
tcomp->add_child(add_to_project);
file_select = memnew(EditorFileDialog);
file_select->set_access(EditorFileDialog::ACCESS_FILESYSTEM);
add_child(file_select);
file_select->set_mode(EditorFileDialog::MODE_OPEN_FILE);
file_select->connect("file_selected", this,"_choose_file");
file_select->add_filter("*.csv ; Translation CSV");
save_select = memnew( EditorDirDialog );
add_child(save_select);
// save_select->set_mode(EditorFileDialog::MODE_OPEN_DIR);
save_select->connect("dir_selected", this,"_choose_save_dir");
get_ok()->connect("pressed", this,"_import");
get_ok()->set_text(TTR("Import"));
error_dialog = memnew ( ConfirmationDialog );
add_child(error_dialog);
error_dialog->get_ok()->set_text(TTR("Accept"));
// error_dialog->get_cancel()->hide();
set_hide_on_ok(false);
columns = memnew( Tree );
vbc->add_margin_child(TTR("Import Languages:"),columns,true);
}
示例15: CheckButton
void DClusterSetManagerPage::appendManagerToList(DClusterUserInfo *info)
{
if(info->getUserRole() == Mi::SySManager || info->getUserRole() == Mi::SeniorManager)
{
CheckButton* btn = new CheckButton(this);
btn->setUserID(info->getUserID());
btn->setUserName(info->getUserName());
btn->setClusterID(info->getClusterID());
if(info->getUserRole() == Mi::SySManager){
btn->setReviewText(tr("群主"));
btn->setReviewEnable(false);
}else{
btn->setReviewText(tr("取消管理员"));
connect(btn, SIGNAL(reviewClicked()), this, SLOT(on_btnCancelManager_clicked()));
}
QPixmap pixmap(ImagePath::USER_PORTRAIT);
pixmap.setDevicePixelRatio(2.0);
btn->setPixMap(pixmap);
btn->setFixedHeight(this->screenHeight()*0.1);
btn->setFixedWidth(this->screenWidth());
btn->setAttribute(Qt::WA_LayoutUsesWidgetRect);
btn->setStyleSheet(SheetStyle::CHECKBUTTON_BOTTOM_BORDER);
btnCheckList.insert(info->getUserID(), btn);
if(managerLayout->count() == 0){
managerLayout->addWidget(btn);
managerLayout->addStretch(0);
}
else{
if(info->getUserRole() == Mi::SySManager)
managerLayout->insertWidget(0, btn);
else
managerLayout->insertWidget(managerLayout->count() - 1, btn);
}
}
}