ParameterDialog::ParameterDialog(Miro::CFG::Type const& _parameterType,
				 QDomNode const& _parentNode, 
				 QDomNode const& _node,
				 ItemXML * _parentItem,
				 ItemXML * _item,
				 QWidget * _parent, const char * _name) :
  Super(_parentNode, _node, _parentItem, _item, _parent, _name),
  config_(ConfigFile::instance()),
  parameterType_(_parameterType),
  params_(config_->description().getFullParameterSet(parameterType_))
{
  MIRO_ASSERT(!_node.isNull());

  initDialog();

  QSize s = frame_->sizeHint();

  if (s.width() > 800 || 
      s.height() > 600) {

    delete frame_;
    QScrollView * sv = new QScrollView(groupBox_, "scrollview");
    frame_ = new QFrame(sv->viewport());
    sv->addChild(frame_);
    sv->setResizePolicy(QScrollView::AutoOneFit);
    
    initDialog();

    frame_->sizeHint();
  }

  groupBox_->sizeHint(); // we seem to need this to get the right size (hutz)
  groupBox_->setTitle("Parameters");
}
예제 #2
0
void LogisticsSaveDialog::beginCampaign()
{
	beginLoad();
	edits[0].limitEntry( 20 );
	bCampaign= true;
	initDialog(campaignPath, 1);
	if ( !gameListBox.GetItemCount() )
	{
		selectedName = "campaign";
		bDone = true;
		return;
	}
	else
	{
		aListItem* pItem = gameListBox.GetItem( 0 );
		if ( pItem )
		{
			pItem->select();
			edits[0].setEntry( ((aTextListItem*)pItem)->getText() );
			selectedName = ( ((aLocalizedListItem*)pItem)->getHiddenText() );
		}
	}


	updateMissionInfo();
}
예제 #3
0
void LogisticsSaveDialog::beginLoad()
{
	beginFadeIn( 0 );
	edits[0].setFocus(true);
	initDialog(savePath, 0);
	status = RUNNING;
	bPromptOverwrite = 0;
	bDeletePrompt = 0;
	bLoad = 1;
	bCampaign = 0;

	// need to change all the texts...
	textObjects[0].setText( IDS_DIALOG_LOAD_GAME );
	textObjects[1].setText( IDS_DIALOG_GAME_LIST );
	textObjects[2].setText( "" );

	buttons[2].setText( IDS_LOAD );

	edits[0].setEntry( "" );
	edits[0].limitEntry( 20 );

	
	aListItem* pItem = gameListBox.GetItem( 0 );
	if ( pItem )
	{
		pItem->select();
		edits[0].setEntry( ((aTextListItem*)pItem)->getText() );
		selectedName = ( ((aLocalizedListItem*)pItem)->getHiddenText() );
	}

	updateMissionInfo();

	LogisticsDialog::begin();

}
예제 #4
0
/////////////////////////////////////////////////////////////////////////////
// handle registering the player
/////////////////////////////////////////////////////////////////////////////
void CNewPlayerDialog::OnRegisterButton() 
{
	CString str;
	CConnectorRegisterDlg dlg;

	//check name
	if(FALSE == validateName())
	{
		return;
	}

	//set the player info
	dlg.setPlayer(m_Player);

	//run the dialog
	if(IDOK == dlg.DoModal())
	{
		m_Player = dlg.getPlayer();

		//reinit
		initDialog();

		//they created a ladder player just now
		m_bLadderNow = TRUE;
	}
}
예제 #5
0
KURLRequesterDlg::KURLRequesterDlg( const TQString& urlName, TQWidget *parent,
        const char *name, bool modal )
    :   KDialogBase( Plain, TQString::null, Ok|Cancel|User1, Ok, parent, name,
                modal, true, KStdGuiItem::clear() )
{
  initDialog(i18n( "Location:" ), urlName);
}
예제 #6
0
void PreferencesDialog::show()
{
	backupDataBase();
	initDialog();
	ShowWindow(preferencesWindow);
	SelectWindow(preferencesWindow);
}
예제 #7
0
Dialog::Dialog( int type, int x, int y ){
    initDialog( x, y );
    switch( type ) {
        case BULLDOZE_MONUMENT:
            askBulldozeMonument();
            break;
        case BULLDOZE_RIVER:
            askBulldozeRiver();
            break;
        case BULLDOZE_SHANTY:
            askBulldozeShanty();
            break;
        case EDIT_MARKET:
            editMarket();
            break;
        case EDIT_PORT:
            editPort();
            break;
        case ASK_LAUNCH_ROCKET:
            askRocket();
            break;
        default:
            std::stringstream msg;
            msg <<"Can't open Dialog type " << type << " with coordinates.";
            throw std::runtime_error(msg.str());
    }
}
예제 #8
0
DomainDialog::DomainDialog(Domain subject, QWidget *parent) :
	QDialog(parent),
	_result(QDialog::Rejected),
	ui(new Ui::DomainDialog),
	_domain(subject)
{
	initDialog();
	setWindowTitle("Edit Domain");

	//Setup the blacklist for the name line edit
	ui->nameEdit->setText(subject.name());
	QStringList blacklist=ConfigurationStack::instance().current().domainNameList();
	blacklist.removeAll(subject.name());
	ui->nameEdit->setBlacklist(blacklist);

	//Setup the data of the widgets
	ui->displayNameEdit->setText(subject.displayName());
	ui->iconButton->setIcon(QIcon(subject.iconPath()));
	ui->iconButton->setToolTip(subject.iconPath());
	ui->descriptionPlainTextEdit->setPlainText(subject.description());
	ui->confidentialitySlider->setValue(subject.confidentiality());
	ui->reliabilitySlider->setValue(subject.reliability());

	//Setup the default domain checkbox depending on whether the domain is default
	if(ConfigurationStack::instance().current().defaultDomain()==subject)
	{
		ui->defaultDomain->setChecked(true);
		ui->defaultDomain->setEnabled(false);
	}
	else
		ui->defaultDomain->setChecked(false);
}
예제 #9
0
// ---------------------------------------------------------------------------
QMessageBox::StandardButton afMessageBox::ShowMessageBox(QMessageBox::Icon type, const QString& title, const QString& text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
{
    QMessageBox::StandardButton retVal = QMessageBox::Ok;

    if (initDialog(title))
    {
        switch (type)
        {
            case QMessageBox::Warning:
                retVal = acMessageBox::instance().warning(title, text, buttons, defaultButton);
                break;

            case QMessageBox::Critical:
                retVal = acMessageBox::instance().critical(title, text, buttons, defaultButton);
                break;

            case QMessageBox::Question:
                retVal = acMessageBox::instance().question(title, text, buttons, defaultButton);
                break;

            //case QMessageBox::NoIcon:
            case QMessageBox::Information:
            default:
                retVal = acMessageBox::instance().information(title, text, buttons, defaultButton);
                break;
        }
    }

    terminateDialog(title);
    return retVal;
}
예제 #10
0
파일: main.cpp 프로젝트: hoangduit/reactos
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch(msg) {
		case WM_INITDIALOG:
			if (!initDialog(hWnd)) {
				PostQuitMessage(0);
			}
			return TRUE;
		case WM_CLOSE:
			DestroyWindow(hWnd);
			return TRUE;
		case WM_NOTIFY:
			return changeTab((LPNMHDR)lParam);
		case WM_DESTROY:
			cleanUp();
			PostQuitMessage(0);
			return TRUE;
		case WM_COMMAND:
			if (LOWORD(wParam) == IDB_CLOSE) {
				PostQuitMessage(0);
				return TRUE;
			}
			if (LOWORD(wParam) == IDB_APPLY) {
				applySettings();
				setDlgItems(hWnd);
				return TRUE;
			}
			break;
	}
	return 0;
}
예제 #11
0
파일: dlgopt.cpp 프로젝트: nrj123/pvb
DlgOpt::DlgOpt(QWidget *parent) : QDialog(parent)
{
  initDialog();

  filename = "";

  QObject::connect(QPushButton_ok,    SIGNAL(clicked()),this,SLOT(okClicked()));
  QObject::connect(QPushButton_cancel,SIGNAL(clicked()),this,SLOT(reject()));
  edit1->setLineWrapMode(QTextEdit::NoWrap);

  /* add layout begin */
  QVBoxLayout *vlayout = new QVBoxLayout(this);
  QHBoxLayout *hlayout = new QHBoxLayout();

  vlayout->addWidget(edit1);
  vlayout->addLayout(hlayout);
  hlayout->addSpacing(10);
  hlayout->addSpacing(200);
  hlayout->addWidget(QPushButton_cancel);
  hlayout->addSpacing(10);
  hlayout->addWidget(QPushButton_ok);
  hlayout->addSpacing(200);
  vlayout->activate();
  /* add layout end */
}
예제 #12
0
//Constructor
QxMainWindow::QxMainWindow(QWidget* parent/*=NULL*/)
	: QMainWindow(parent)
{
	QMap<quint32, quint32> m_LabelCodeMap;
	QMap<QString, quint32> m_ImageLabelMap;
	initDialog();
}
DIALOG_COPPER_ZONE::DIALOG_COPPER_ZONE( PCB_BASE_FRAME* aParent, ZONE_SETTINGS* aSettings ) :
    DIALOG_COPPER_ZONE_BASE( aParent )
{
    m_Parent = aParent;
    m_Config = Kiface().KifaceSettings();

    m_ptr = aSettings;
    m_settings = *aSettings;

    m_NetSortingByPadCount = true;      // false = alphabetic sort, true = pad count sort
    m_OnExitCode = ZONE_ABORT;

    SetReturnCode( ZONE_ABORT );        // Will be changed on buttons click

    // Fix static text widget minimum width to a suitable value so that
    // resizing the dialog is not necessary when changing the corner smoothing type.
    // Depends on the default text in the widget.
    m_cornerSmoothingTitle->SetMinSize( m_cornerSmoothingTitle->GetSize() );

    initDialog();

    m_sdbSizerOK->SetDefault();
    GetSizer()->SetSizeHints( this );
    Center();
}
예제 #14
0
ann_gui::SamplesDialog::SamplesDialog(MLPTrainingResult *tr, QWidget *parent) :
	QDialog(parent),
	ui(new Ui::SamplesDialog)
{
//    Q_INIT_RESOURCE(ann_gui_media); //never call it inside a namespace, instead use a wrapper function

	initDialog(tr);
}
예제 #15
0
AbstractItemDetail::AbstractItemDetail(const QModelIndex *index)
{
	Q_UNUSED(index)

	initDialog();
	retrieveItem();
	fillData();
}
예제 #16
0
EventFilterDialog::EventFilterDialog(QWidget* parent)
        : QDialog(parent),
        m_standardQuantizations(BasicQuantizer::getStandardQuantizations())
{
    //###JAS next line not needed.  Commented out.
    //###settings = confq4;
    initDialog();
}
예제 #17
0
/*
 * DIALOG_SVG_PRINT functions
 */
DIALOG_SVG_PRINT::DIALOG_SVG_PRINT( EDA_DRAW_FRAME* parent ) :
    DIALOG_SVG_PRINT_base( parent )
{
    m_parent    = (PCB_BASE_FRAME*) parent;
    m_config    = wxGetApp().GetSettings();
    initDialog();
    GetSizer()->SetSizeHints( this );
    Centre();
}
예제 #18
0
MRuleDialog::MRuleDialog(Program prog, QWidget *parent) :
	QDialog(parent),
	ui(new Ui::MRuleDialog),
	_prog(prog),
	_current_variable_type(Type::Invalid)
{
	initDialog();
	setWindowTitle("New Matching Rule");
}
예제 #19
0
PropertySelectionTreeDialog::PropertySelectionTreeDialog(ProcessorNetwork* processorNetwork,
        std::vector<Property*>& selectedProperty,
        QWidget* parent)
    : QDialog(parent), selectedProperties_(selectedProperty),
      processorNetwork_(processorNetwork)
{
    initDialog();
    selectionTree_->addProcessorNetwork(processorNetwork);
}
DIALOG_FOOTPRINTS_DISPLAY_OPTIONS::DIALOG_FOOTPRINTS_DISPLAY_OPTIONS( PCB_BASE_FRAME* parent )
    : DIALOG_FOOTPRINTS_DISPLAY_OPTIONS_BASE( parent )
{
    m_Parent = parent;

    initDialog();
    m_sdbSizer1OK->SetDefault();
    GetSizer()->SetSizeHints( this );
    Centre();
}
예제 #21
0
void UserMenuDialog::updateAfterDelete()
{
	if ( m_menutree->isEmpty() ) {
		initDialog();
	}

	updateTreeButtons();
	setModified();

}
예제 #22
0
void UserMenuDialog::loadXmlFile(const QString &filename, bool installed)
{
	KILE_DEBUG() << "load xml started ...";
	m_menutree->readXml(filename);
	initDialog();
	m_modified = false;
	setXmlFile(filename,installed);
	updateDialogButtons();
	KILE_DEBUG() << "load xml finished ...";
}
SurfaceSettingsDialog::SurfaceSettingsDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::SurfaceSettingsDialog)
{
    ui->setupUi(this);

    this->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);

    initDialog();
}
LAYERS_MAP_DIALOG::LAYERS_MAP_DIALOG( GERBVIEW_FRAME* parent ) :
    LAYERS_MAP_DIALOG_BASE( parent )
{
    m_Parent = parent;
    initDialog();

    // Resize the dialog
    Layout();
    GetSizer()->SetSizeHints( this );
    Centre();
}
    DIALOG_GEN_MODULE_POSITION( PCB_EDIT_FRAME * aParent ):
        DIALOG_GEN_MODULE_POSITION_BASE( aParent ),
        m_parent( aParent ),
        m_plotOpts( aParent->GetPlotSettings() )
    {
        m_reporter = &m_messagesPanel->Reporter();
        initDialog();

        GetSizer()->SetSizeHints(this);
        Centre();
    }
예제 #26
0
Dialog::Dialog( int type, std::string message, std::string extraString){
    initDialog();   
    switch( type ){
        case MSG_DIALOG:
            msgDialog( message, extraString );
            break;
        default:
            std::stringstream msg;
            msg <<"Can't open Dialog type " << type << " with String parameters.";
            throw std::runtime_error(msg.str());
    }
}
DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* parent ) :
    DIALOG_GENDRILL_BASE( parent )
{
    m_parent = parent;
    m_board  = parent->GetBoard();
    m_config = Kiface().KifaceSettings();
    m_plotOpts = m_parent->GetPlotSettings();

    SetReturnCode( 1 );
    initDialog();
    GetSizer()->SetSizeHints( this );
}
예제 #28
0
COptions::COptions(QWidget *parent, const char *name, void *o)
: QDialog(parent){
	
	unsigned int i;
	char         buffer[100];
	
//	setCaption("Options");
	move(POS_X, POS_Y);
	initDialog();
	connect(QPushButton_CANCEL, SIGNAL(clicked()), this, SLOT(reject()));
	connect(QScrollBar_EMPTY, SIGNAL(valueChanged(int)), this, SLOT(newEmpty(int)));
	connect(QPushButton_OK, SIGNAL(clicked()), this, SLOT(ok()));
			
	connect(QRadioButton_COLOR, SIGNAL(clicked()), this, SLOT(slotRadioColor()));
	connect(QRadioButton_FILE, SIGNAL(clicked()), this, SLOT(slotRadioFile()));
	//connect(QPushButton_SELECTCOLOR, SIGNAL(clicked()), this, SLOT(slotSelectColor()));
	connect(QPushButton_SELECTFILE, SIGNAL(clicked()), this, SLOT(slotSelectFile()));
	
	memcpy(&opt, (struct options*)o, sizeof(opt));

	parent_class = (Freecell*)parent;

	QSpinBox_NUMFREECELLS->setValue(*opt.num_freecells);
	QSpinBox_NUMFREECELLS->setRange(*opt.spinbox_freecells_min, 4);
	
	if(*opt.background_enabled)
	{
		QRadioButton_FILE->setChecked(true);
		QRadioButton_COLOR->setChecked(false);
		QLineEdit_BACKGROUND->setText(opt.background_file);
	}
	else
	{
		QRadioButton_FILE->setChecked(false);
		QRadioButton_COLOR->setChecked(true);
	}

//	QWidget_COLORWIDGET->setBackgroundColor(*opt.background_color);
	QLineEdit_BACKGROUND->setText(opt.background_file);
	
	// read card layouts for cells
	sprintf(buffer, "%s/freecells", ((Freecell*)parent)->directory);
	dir.setPath(buffer);
        dir.setNameFilters(QStringList() << "*.bmp");
		
	selected = 0;
	
	if(dir.count()-1>0)
		QScrollBar_EMPTY->setRange(0, dir.count()-1);
	else QScrollBar_EMPTY->setRange(0, 0);
	QScrollBar_EMPTY->setValue(selected);
}
예제 #29
0
MainDialog::MainDialog(HINSTANCE hInst):
   BaseDialog(hInst),
   _settingDialog(hInst),
   _context(GoPlusContext::instance())
{ 
   _context.notificationCenter().addObserver(Poco::NObserver<MainDialog, StatusNotification>(*this, &MainDialog::updateStatus));
   _context.notificationCenter().addObserver(Poco::NObserver<MainDialog, CapturesNotification>(*this, &MainDialog::updateCapturesInformation));
   _context.notificationCenter().addObserver(Poco::NObserver<MainDialog, ScoreNotification>(*this, &MainDialog::updateScore));

   create(IDD_DIALOG_MAIN);
   initNotifyIcon();
   initDialog();
}
예제 #30
0
/////////////////////////////////////////////////////////////////////////////
// startup
/////////////////////////////////////////////////////////////////////////////
BOOL CNewPlayerDialog::OnInitDialog() 
{
	CHelpDialog::OnInitDialog();

	//help system
	m_strHelp = HELP_ADDPLAYER;

	//init
	initDialog();

	return FALSE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}