void ToolsOptionsWindow::CreateGeneralPanel ()
{
	m_pfoldersframe = CreateGroupBox ("Protected Folders", 130, 15, 390, 103, ID_LBLSTATIC);
	
	m_pfoldersinfo1 = CreateLabel ("When my computer starts up / wakes up:", 140, 35, 300, 20, ID_LBLSTATIC);
	m_pfolderspromptpowerup = CreateCheckBox ("Ask me before Decrypting protected folders", 155, 53, 300, 20, ID_CHKPFOLDERPROMPTPUP);
	m_pfoldersinfo2 = CreateLabel ("When my computer shuts down / sleeps:", 140, 75, 300, 20, ID_LBLSTATIC);
	m_pfolderspromptpowerdown = CreateCheckBox ("Ask me before Encrypting protected folders", 155, 92, 300, 20, ID_CHKPFOLDERPROMPTPDN);

	m_ptextencframe = CreateGroupBox ("Universal Text Encryption", 130, 130, 390, 120, ID_LBLSTATIC);
	
	m_lblenc = CreateLabel ("Encrypt Hotkey", 170, 164, 100, 20, ID_LBLSTATIC);
	m_chkencctrl = CreateCheckBox ("Ctrl", 280, 163, 40, 20, ID_UTEBTNHOTENCCTRL);
	m_chkencalt = CreateCheckBox ("Alt", 340, 163, 40, 20, ID_UTEBTNHOTENCALT);
	m_txtenckey = CreateTextBox (400, 163, 40, 20, ID_UTETXTHOTENC);

	m_lbldec = CreateLabel ("Decrypt Hotkey", 170, 194, 100, 20, ID_LBLSTATIC);
	m_chkdecctrl = CreateCheckBox ("Ctrl", 280, 193, 40, 20, ID_UTEBTNHOTDECCTRL);
	m_chkdecalt = CreateCheckBox ("Alt", 340, 193, 40, 20, ID_UTEBTNHOTDECALT);
	m_txtdeckey = CreateTextBox (400, 193, 40, 20, ID_UTETXTHOTDEC);

	m_lblinfo = CreateLabel ("NOTE: Hot Key settings will take effect after next reboot.", 170, 227, 300, 20, ID_LBLSTATIC);

	m_autoupdateframe = CreateGroupBox ("Automatic Updates", 130, 265, 390, 103, ID_LBLSTATIC);
	m_chkautoupdate = CreateCheckBox ("Automatically check online for a newer version of CedeCrypt", 155, 310, 300, 20, ID_CHKAUTOUPDATECHECK);

	ShowWindow (m_chkencalt, SW_HIDE);
	ShowWindow (m_chkdecalt, SW_HIDE);
}
예제 #2
0
static void AddListFGroup(t_x11 *x11, t_dlgitemlist **grid,
			  t_fgroup *fgroup, t_id *ID,bool bUseMon)
{
  int i;
  t_id GroupID,*ids;
  t_dlgitemlist *item;
  int x,y,w;
  
  GroupID=(*ID)++;
  item=&(grid[fgroup->x][fgroup->y]);
  AddListItem(item,CreateGroupBox(x11,fgroup->name,GroupID,
				  0,NULL,0,0,0,0,0));
  x=2*OFFS_X;
  y=item->list[0]->win.y+item->list[0]->win.height;
  w=0;
  for(i=0; (i<fgroup->nfitem); i++)
    AddListFItem(x11,item,fgroup->fitem[i],GroupID,ID,x,&y,&w,bUseMon);
  
  w=max(w,item->list[0]->win.width+4*OFFS_X);
  sfree(item->list[0]->u.groupbox.item);
  sfree(item->list[0]->win.text);
  snew(ids,item->nitem);
  for(i=0; (i<item->nitem-1); i++)
    ids[i]=GroupID+i+1;
  item->list[0]=
    CreateGroupBox(x11,fgroup->name,GroupID,item->nitem-1,ids,
		   2*OFFS_X,2*OFFS_Y,w+2*OFFS_X,y,0);
  sfree(ids);
  item->w=fgroup->w;
  item->h=fgroup->h;
}
예제 #3
0
void CViewControlsPanelGeneralPlots::CreateWidgets()
{
	layout()->removeItem(mViewsLayout);

    mPlotTypesList = new QListWidget;
    mPlotTypesList->setToolTip( "Select a plot type" );
	mPlotTypesList->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );
	mPlotTypesList->setMaximumHeight( MaxSmallListsHeight() );

    auto *types_group = CreateGroupBox( ELayoutType::Vertical, { mPlotTypesList }, "Plot Type", nullptr, s, m, m, m, m );
	mPlotTypesList->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );

    auto *views_layout = LayoutWidgets( Qt::Horizontal, { mViewsLayout }, nullptr, s, m, m, m, m );

    mLinkToPlot = new QComboBox;
    auto *link_group = CreateGroupBox( ELayoutType::Vertical, { mLinkToPlot }, "Link to Plot", nullptr, s, m, m, m, m );
	link_group->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );

	AddTopLayout( ELayoutType::Horizontal, 
	{ 
        views_layout, types_group, LayoutWidgets( Qt::Vertical, { link_group }, nullptr )
	}, 
	s, m, m, m, m );

	link_group->setVisible( false );		//TODO	delete when implemented
}
예제 #4
0
void  CDataDisplayPropertiesDialog::CreateWidgets()
{
    //	Vector fields

    mNorthComponent = new QRadioButton( "North Component" );
    mEastComponent = new QRadioButton( "East Component" );
    mVectorBox = CreateGroupBox( ELayoutType::Vertical,
    {
        mNorthComponent,
        mEastComponent
    },
    "Vector Plot Component", nullptr );
    mVectorBox->setCheckable(true);
    mVectorBox->setChecked(false);


    //	... Help

    auto help = new CTextWidget;
    QString name = t2q( mFormula->GetName() );
    help->SetHelpProperties(
                "Edit the expression '" + name + "' display properties.\n"
                "Vector box is available only if a map operation has more than 1 data field.",
        0 , 6 );
    auto help_group = CreateGroupBox( ELayoutType::Grid, { help }, "", nullptr, 6, 6, 6, 6, 6 );
    help_group->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );

    //	... Buttons

    mButtonBox = new QDialogButtonBox( this );
    mButtonBox->setObjectName( QString::fromUtf8( "mButtonBox" ) );
    mButtonBox->setOrientation( Qt::Horizontal );
    mButtonBox->setStandardButtons( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
    mButtonBox->button( QDialogButtonBox::Ok )->setDefault( true );

	QBoxLayout *main_l =
		LayoutWidgets( Qt::Vertical,
		{
			mVectorBox,
			WidgetLine( this, Qt::Horizontal ),
			help_group,
			WidgetLine( this, Qt::Horizontal ),
			mButtonBox

		}, this, 6, 6, 6, 6, 6 );                       Q_UNUSED( main_l );


    //	Wrap up dimensions

    adjustSize();
    setMinimumWidth( width() );

    Wire();
}
예제 #5
0
void HotkeyTAS::CreateMainLayout()
{
  m_main_layout = new QHBoxLayout();

  m_main_layout->addWidget(
      CreateGroupBox(tr("Frame Advance"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_FRAME_ADVANCE)));
  m_main_layout->addWidget(
      CreateGroupBox(tr("Movie"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_MOVIE)));

  setLayout(m_main_layout);
}
예제 #6
0
void HotkeyStatesOther::CreateMainLayout()
{
  auto* layout = new QHBoxLayout;

  layout->addWidget(
      CreateGroupBox(tr("Select Last State"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_SELECT_STATE)));
  layout->addWidget(CreateGroupBox(tr("Load Last State"),
                                   HotkeyManagerEmu::GetHotkeyGroup(HKGP_LOAD_LAST_STATE)));
  layout->addWidget(
      CreateGroupBox(tr("Other State Hotkeys"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_STATE_MISC)));

  setLayout(layout);
}
예제 #7
0
void CInsertFunctionDialog::CreateWidgets()
{
	mFunctionCategories = new QComboBox;
	mFunctionList = new QListWidget;

	auto *widgets_l = CreateGroupBox( ELayoutType::Vertical,
	{
		new QLabel( "Select a Category" ), mFunctionCategories, new QLabel( "Select a Function" ), mFunctionList
	},
	"", nullptr, 2, 2, 2, 2, 2 );


    //... Help

    mHelpText = new CTextWidget;
	//mHelpText->setHelpProperties( "" , 6, Qt::AlignCenter );
    auto help_group = CreateGroupBox( ELayoutType::Vertical, { mHelpText }, "", nullptr, 6, 6, 6, 6, 6 );
    //help_group->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );

    //... Buttons

    mButtonBox = new QDialogButtonBox( this );
    mButtonBox->setObjectName( QString::fromUtf8( "mButtonBox" ) );
    mButtonBox->setOrientation( Qt::Horizontal );
    mButtonBox->setStandardButtons( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
    mButtonBox->button( QDialogButtonBox::Ok )->setDefault( true );


    //... All

	QSplitter *splitter = CreateSplitter( nullptr, Qt::Vertical, { widgets_l, help_group } );

    QBoxLayout *main_l = LayoutWidgets( Qt::Vertical,
                            {
								splitter,
                                mButtonBox

                            }, this, 6, 6, 6, 6, 6 );                       Q_UNUSED( main_l );


    setWindowTitle( "Insert Function");

    //	Wrap up dimensions

    adjustSize();
    setMinimumWidth( width() );

	Setup();
}
예제 #8
0
void HotkeyGeneral::CreateMainLayout()
{
  m_main_layout = new QHBoxLayout();

  m_main_layout->addWidget(
      CreateGroupBox(tr("General"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_GENERAL)));

  auto* vbox = new QVBoxLayout();
  vbox->addWidget(CreateGroupBox(tr("Volume"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_VOLUME)));
  vbox->addWidget(
      CreateGroupBox(tr("Emulation Speed"), HotkeyManagerEmu::GetHotkeyGroup(HKGP_SPEED)));
  m_main_layout->addLayout(vbox);

  setLayout(m_main_layout);
}
void WiimoteEmuMotionControl::CreateMainLayout()
{
  m_main_layout = new QHBoxLayout();

  m_main_layout->addWidget(CreateGroupBox(
      tr("Shake"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Shake)));
  m_main_layout->addWidget(
      CreateGroupBox(tr("IR"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::IR)));
  m_main_layout->addWidget(CreateGroupBox(
      tr("Tilt"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Tilt)));
  m_main_layout->addWidget(CreateGroupBox(
      tr("Swing"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Swing)));

  setLayout(m_main_layout);
}
void ToolsOptionsWindow::CreateAlgorithmsPanel ()
{
	m_algframe = CreateGroupBox ("Encryption Algorithms", 130, 15, 390, 403, ID_LBLSTATIC);

	m_algimage.SetBitmapResources (IDB_ALGORITHMSIMAGE);
	m_algimage.SetBitmapProperties (0, 0, 345, 254);
	m_algimage.SetProperties (m_hwnd, CID_HEADER, 170, 75, 345, 254);
	m_uihandler.AddDirectControl (&m_algimage);

	/*

	#define ID_OPTALGCYBERCEDE				943
	#define ID_OPTALGAES256					944
	#define ID_OPTALG3DES					945
	#define ID_OPTALGDES					946
	ID_LBLCURRENTALG
	*/

	m_algoptcybercede = CreateRadioButton ("", 145, 95, 15, 15, ID_OPTALGCYBERCEDE);
	m_algoptaes256 = CreateRadioButton ("", 145, 160, 15, 15, ID_OPTALGAES256);
	m_algopt3des = CreateRadioButton ("", 145, 225, 15, 15, ID_OPTALG3DES);
	m_algoptdes = CreateRadioButton ("", 145, 290, 15, 15, ID_OPTALGDES);

	m_lblcurrentalg = CreateLabel ("Current Selected Algorithm: ", 173, 45, 290, 19, ID_LBLCURRENTALG);
}
예제 #11
0
void CWorkspaceViewsDialog::CreateWidgets()
{
	static const QStringList header_labels = QStringList() << tr( "Name" ) << tr( "Type" ) << tr( "Value" );

	const std::string wname = mModel.RootWorkspace()->GetName();

	//	Create

	//	... Tree

	mViewsListWidget = new QListWidget( this );
	mViewsListWidget->setSelectionBehavior( QAbstractItemView::SelectRows );
	mViewsListWidget->setSelectionMode( QAbstractItemView::SingleSelection );
	mViewsListWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::MinimumExpanding );

	mMapsAsPlotsCheckBox = new QCheckBox( "Display maps as 3D plots" );


	//	... Help

	auto help = new CTextWidget;
	help->SetHelpProperties( "All views generated by the operations of workspace " + t2q( wname ), 0, 6, Qt::AlignCenter );
    auto help_group = CreateGroupBox( ELayoutType::Grid, { help }, "", nullptr, 6, 6, 6, 6, 6 );
    help_group->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );


	//	... Buttons

	mButtonBox = new QDialogButtonBox( this );
	mButtonBox->setObjectName( QString::fromUtf8( "mButtonBox" ) );
	mButtonBox->setOrientation( Qt::Horizontal );
	mButtonBox->setStandardButtons( QDialogButtonBox::Open | QDialogButtonBox::Cancel );
    mButtonBox->button( QDialogButtonBox::Open )->setDefault( true );


    QBoxLayout *main_l =
            LayoutWidgets( Qt::Vertical,
                            {
                                mViewsListWidget,
								mMapsAsPlotsCheckBox,
								help_group,
                                mButtonBox

                            }, this, 6, 6, 6, 6, 6 );                       Q_UNUSED( main_l );


    setWindowTitle( "Workspace Views - " + t2q( wname ) );

    //	Wrap up dimensions

    adjustSize();
	setMinimumWidth( width() );

	Wire();
}
예제 #12
0
void CViewControlsPanelGeneral::CreateWidgets()
{
	// I. Top Buttons Row

	mNewDisplayButton = CreateToolButton( "", ":/images/OSGeo/new.png", "Create a new view" );
    mRenameDisplayButton = CreateToolButton( "", ":/images/OSGeo/edit.png", "Rename the selected view" );
	mDeleteDisplayButton = CreateToolButton( "", ":/images/OSGeo/workspace-delete.png", "Delete the selected view" );
	mExecuteDisplay = CreateToolButton( "Reset", ":/images/OSGeo/execute.png", "Rebuild the view(s)" );
	mExecuteDisplay->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );


	QWidget *top_buttons_row = CreateButtonRow( false, Qt::Horizontal, 
	{ 
		mNewDisplayButton, mRenameDisplayButton, mDeleteDisplayButton, nullptr, mExecuteDisplay
	} );

	// II. Left Layout

    mDisplaysCombo = new QComboBox;
    mDisplaysCombo->setToolTip( "Open a view" );
	mDisplaysCombo->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );

	auto title_label = new QLabel( "Title" );
	title_label->setToolTip( "Press enter to assign new title" );
    mPlotTitle = new QLineEdit(this);
    mPlotType = new QLineEdit(this);
	SetReadOnlyEditor( mPlotType, true );

	auto *plots_group = //CreateGroupBox( ELayoutType::Horizontal,
			LayoutWidgets( Qt::Horizontal,
	{
		CreateGroupBox( ELayoutType::Horizontal,
		{
            mDisplaysCombo, title_label, mPlotTitle, new QLabel( "Type" ), mPlotType
        }, "Operation Views", nullptr ),
	},
	nullptr, s, m, m, m, m );
    mPlotType->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );

    auto *plots_l = LayoutWidgets( Qt::Vertical, 
	{ 
        top_buttons_row,
		plots_group
	}, 
	nullptr, 4, 4, top_margin, 4, top_margin );


	mViewsLayout = LayoutWidgets( Qt::Horizontal, { plots_l }, nullptr, s, m, m, m, m );
}
예제 #13
0
void CActiveViewsDialog::CreateWidgets()
{
	static const QStringList header_labels = QStringList() << tr( "Name" ) << tr( "Type" ) << tr( "Value" );

	//	Create

	//	... Tree

	mViewsListWidget = new QListWidget( this );
	mViewsListWidget->setSelectionBehavior( QAbstractItemView::SelectRows );
	mViewsListWidget->setSelectionMode( QAbstractItemView::SingleSelection );
	mViewsListWidget->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::MinimumExpanding );

	//	... Help

	auto help = new CTextWidget;
	help->SetHelpProperties( "Select a view from all view windows currently opened", 0, 6, Qt::AlignCenter );
    auto help_group = CreateGroupBox( ELayoutType::Grid, { help }, "", nullptr, 6, 6, 6, 6, 6 );
    help_group->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );


	//	... Buttons

	mCloseDialogButton = new QPushButton( "Done", this );
	mCloseWindowButton = new QPushButton( "Close", this );
	mSelectWindowButton = new QPushButton( "Select", this );

	auto *buttons = LayoutWidgets( Qt::Horizontal, { mSelectWindowButton, mCloseWindowButton, nullptr, mCloseDialogButton }, nullptr, 2, 2, 2, 2, 2 );

    QBoxLayout *main_l =
            LayoutWidgets( Qt::Vertical,
                            {
                                mViewsListWidget,
								help_group,
                                buttons

                            }, this, 6, 6, 6, 6, 6 );                       Q_UNUSED( main_l );


    setWindowTitle( "Active Views" );

    //	Wrap up dimensions

    adjustSize();
	setMinimumWidth( width() );

	Wire();
}
예제 #14
0
void  CEditTasksFileDialog::CreateWidgets()
{
    //	Text

	mTextEdit = new CTextWidget;
	mTextEdit->SetSizeHint( mTextEdit->sizeHint().width(), 2 * mTextEdit->sizeHint().height() );
	auto *content_l = LayoutWidgets( Qt::Vertical, { mTextEdit }, nullptr, 2, 2, 2, 2, 2 );


    //	... Help

    auto help = new CTextWidget;
	std::string help_str = mTaskName.empty() ? "Scheduled tasks configuration file." : mTaskName + " log file content.";
    help->SetHelpProperties( help_str.c_str(), 0 , 6 );
    auto help_group = CreateGroupBox( ELayoutType::Grid, { help }, "", nullptr, 6, 6, 6, 6, 6 );
    help_group->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );


    //	... Buttons

    mButtonBox = new QDialogButtonBox( this );
    mButtonBox->setObjectName( QString::fromUtf8( "mButtonBox" ) );
    mButtonBox->setOrientation( Qt::Horizontal );
    mButtonBox->setStandardButtons( QDialogButtonBox::Close );
    mButtonBox->button( QDialogButtonBox::Close )->setDefault( true );

    QBoxLayout *main_l =
            LayoutWidgets( Qt::Vertical,
                            {
								content_l,
								WidgetLine( nullptr, Qt::Horizontal ),
                                help_group,
                                mButtonBox

                            }, this, 6, 6, 6, 6, 6 );                       Q_UNUSED( main_l );


    //	Wrap up dimensions

    adjustSize();
    setMinimumWidth( width() );

   Wire();
}
예제 #15
0
void WiimoteEmuGeneral::CreateMainLayout()
{
  m_main_layout = new QHBoxLayout();

  auto* vbox_layout = new QVBoxLayout();

  m_main_layout->addWidget(CreateGroupBox(
      tr("Buttons"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Buttons)));
  m_main_layout->addWidget(CreateGroupBox(
      tr("D-Pad"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::DPad)));
  m_main_layout->addWidget(CreateGroupBox(
      tr("Hotkeys"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Hotkeys)));

  auto* extension_group =
      Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Attachments);
  auto* extension = CreateGroupBox(tr("Extension"), extension_group);
  auto* ce_extension = static_cast<ControllerEmu::Attachments*>(extension_group);
  m_extension_combo = new QComboBox();

  for (const auto& attachment : ce_extension->GetAttachmentList())
  {
    // TODO: Figure out how to localize this
    m_extension_combo->addItem(QString::fromStdString(attachment->GetName()));
  }

  extension->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);

  static_cast<QFormLayout*>(extension->layout())->addRow(m_extension_combo);

  vbox_layout->addWidget(extension);
  vbox_layout->addWidget(CreateGroupBox(
      tr("Rumble"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Rumble)));

  vbox_layout->addWidget(CreateGroupBox(
      tr("Options"), Wiimote::GetWiimoteGroup(GetPort(), WiimoteEmu::WiimoteGroup::Options)));

  m_main_layout->addLayout(vbox_layout);

  setLayout(m_main_layout);
}
예제 #16
0
void CExportImageDialog::CreateWidgets( bool enable2D, bool enable3D )
{
    // Output type

	mExtensionCombo = new QComboBox;
    m2DCheck = new QCheckBox( "2D" );
    m3DCheck = new QCheckBox( "3D" );
    auto *output_type_group = CreateGroupBox( ELayoutType::Horizontal, { mExtensionCombo, nullptr, m2DCheck, m3DCheck }, "Image and File Type", nullptr, 6, 6, 6, 6, 6 );


    // Output file

    mOutputPathLineEdit2D = new QLineEdit();
    mOutputPathLineEdit2D->setReadOnly( true );
    mBrowseButton2D = new QPushButton( "Browse..." );
    mOutputPathLineEdit3D = new QLineEdit();
    mOutputPathLineEdit3D->setReadOnly( true );
    mBrowseButton3D = new QPushButton( "Browse..." );
	mBrowseButton2D->setToolTip( CActionInfo::FormatTip( "Select output file name and location." ).c_str() );
	mBrowseButton3D->setToolTip( CActionInfo::FormatTip( "Select output file name and location." ).c_str() );

    mOutputFileGroup2D = CreateGroupBox( ELayoutType::Horizontal, { mOutputPathLineEdit2D, mBrowseButton2D }, "2D Output File", nullptr, 6, 6, 6, 6, 6 );
    mOutputFileGroup3D = CreateGroupBox( ELayoutType::Horizontal, { mOutputPathLineEdit3D, mBrowseButton3D }, "3D Output File", nullptr, 6, 6, 6, 6, 6 );


    // Help

    auto help = new CTextWidget;
    help->SetHelpProperties( 
		"Select a file name and location. The extension will\n"
		"automatically be assigned according to the chosen image type."
         ,0 , 6, Qt::AlignCenter );
    auto help_group = CreateGroupBox( ELayoutType::Grid, { help }, "", nullptr, 6, 6, 6, 6, 6 );
    help_group->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Maximum );


    //	Buttons (Execute, Delay Execution, Cancel)

    mButtonBox = new QDialogButtonBox();
    mButtonBox->setObjectName( QString::fromUtf8( "mButtonBox" ) );
    mButtonBox->setOrientation( Qt::Horizontal );
    mButtonBox->setStandardButtons( QDialogButtonBox::Save | QDialogButtonBox::Cancel );    
	mSaveButton = mButtonBox->button( QDialogButtonBox::Save );
    mSaveButton->setDefault( false );

	mOutputFileGroup2D->setStyleSheet("QGroupBox { font-weight: bold; } ");
	mOutputFileGroup3D->setStyleSheet("QGroupBox { font-weight: bold; } ");
	output_type_group->setStyleSheet("QGroupBox { font-weight: bold; } ");


    //	All

    QBoxLayout *main_l =
            LayoutWidgets( Qt::Vertical,
                            {
								output_type_group,
                                mOutputFileGroup2D,
                                mOutputFileGroup3D,
								nullptr,
                                help_group,
                                mButtonBox

                            }, this, 6, 6, 6, 6, 6 );                       Q_UNUSED( main_l );


    Wire( enable2D, enable3D );
}
예제 #17
0
//--------------------------------------------------------
// Special Hook Procedure for handling the print dialog messages
static UINT CALLBACK PrintHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam) 
{

  if (uiMsg == WM_COMMAND) {
    UINT id = LOWORD(wParam);
    if (id == rad4 || id == rad5 || id == rad6) {
      gFrameSelectedRadioBtn = id;
      SetRadioOfGroup(hdlg, id);
    }

  } else if (uiMsg == WM_INITDIALOG) {
    PRINTDLG * printDlg = (PRINTDLG *)lParam;
    if (printDlg == nullptr) return 0L;

    int16_t howToEnableFrameUI = (int16_t)printDlg->lCustData;
    // don't add frame options if they would be disabled anyway
    // because there are no frames
    if (howToEnableFrameUI == nsIPrintSettings::kFrameEnableNone)
      return TRUE;

    HINSTANCE hInst = (HINSTANCE)::GetWindowLongPtr(hdlg, GWLP_HINSTANCE);
    if (hInst == nullptr) return 0L;

    // Start by getting the local rects of several of the controls
    // so we can calculate where the new controls are
    HWND wnd = ::GetDlgItem(hdlg, grp1);
    if (wnd == nullptr) return 0L;
    RECT dlgRect;
    GetLocalRect(wnd, dlgRect, hdlg);

    wnd = ::GetDlgItem(hdlg, rad1); // this is the top control "All"
    if (wnd == nullptr) return 0L;
    RECT rad1Rect;
    GetLocalRect(wnd, rad1Rect, hdlg);

    wnd = ::GetDlgItem(hdlg, rad2); // this is the bottom control "Selection"
    if (wnd == nullptr) return 0L;
    RECT rad2Rect;
    GetLocalRect(wnd, rad2Rect, hdlg);

    wnd = ::GetDlgItem(hdlg, rad3); // this is the middle control "Pages"
    if (wnd == nullptr) return 0L;
    RECT rad3Rect;
    GetLocalRect(wnd, rad3Rect, hdlg);

    HWND okWnd = ::GetDlgItem(hdlg, IDOK);
    if (okWnd == nullptr) return 0L;
    RECT okRect;
    GetLocalRect(okWnd, okRect, hdlg);

    wnd = ::GetDlgItem(hdlg, grp4); // this is the "Print range" groupbox
    if (wnd == nullptr) return 0L;
    RECT prtRect;
    GetLocalRect(wnd, prtRect, hdlg);


    // calculate various different "gaps" for layout purposes

    int rbGap     = rad3Rect.top - rad1Rect.bottom;     // gap between radiobtns
    int grpBotGap = dlgRect.bottom - rad2Rect.bottom;   // gap from bottom rb to bottom of grpbox
    int grpGap    = dlgRect.top - prtRect.bottom ;      // gap between group boxes
    int top       = dlgRect.bottom + grpGap;            
    int radHgt    = rad1Rect.bottom - rad1Rect.top + 1; // top of new group box
    int y         = top+(rad1Rect.top-dlgRect.top);     // starting pos of first radio
    int rbWidth   = dlgRect.right - rad1Rect.left - 5;  // measure from rb left to the edge of the groupbox
                                                        // (5 is arbitrary)
    nsIntRect rect;

    // Create and position the radio buttons
    //
    // If any one control cannot be created then 
    // hide the others and bail out
    //
    rect.SetRect(rad1Rect.left, y, rbWidth,radHgt);
    HWND rad4Wnd = CreateRadioBtn(hInst, hdlg, rad4, kAsLaidOutOnScreenStr, rect);
    if (rad4Wnd == nullptr) return 0L;
    y += radHgt + rbGap;

    rect.SetRect(rad1Rect.left, y, rbWidth, radHgt);
    HWND rad5Wnd = CreateRadioBtn(hInst, hdlg, rad5, kTheSelectedFrameStr, rect);
    if (rad5Wnd == nullptr) {
      Show(rad4Wnd, FALSE); // hide
      return 0L;
    }
    y += radHgt + rbGap;

    rect.SetRect(rad1Rect.left, y, rbWidth, radHgt);
    HWND rad6Wnd = CreateRadioBtn(hInst, hdlg, rad6, kEachFrameSeparately, rect);
    if (rad6Wnd == nullptr) {
      Show(rad4Wnd, FALSE); // hide
      Show(rad5Wnd, FALSE); // hide
      return 0L;
    }
    y += radHgt + grpBotGap;

    // Create and position the group box
    rect.SetRect (dlgRect.left, top, dlgRect.right-dlgRect.left+1, y-top+1);
    HWND grpBoxWnd = CreateGroupBox(hInst, hdlg, grp3, NS_LITERAL_STRING("Print Frame"), rect);
    if (grpBoxWnd == nullptr) {
      Show(rad4Wnd, FALSE); // hide
      Show(rad5Wnd, FALSE); // hide
      Show(rad6Wnd, FALSE); // hide
      return 0L;
    }

    // Here we figure out the old height of the dlg
    // then figure its gap from the old grpbx to the bottom
    // then size the dlg
    RECT pr, cr; 
    ::GetWindowRect(hdlg, &pr);
    ::GetClientRect(hdlg, &cr);

    int dlgHgt = (cr.bottom - cr.top) + 1;
    int bottomGap = dlgHgt - okRect.bottom;
    pr.bottom += (dlgRect.bottom-dlgRect.top) + grpGap + 1 - (dlgHgt-dlgRect.bottom) + bottomGap;

    ::SetWindowPos(hdlg, nullptr, pr.left, pr.top, pr.right-pr.left+1, pr.bottom-pr.top+1, 
                   SWP_NOMOVE|SWP_NOREDRAW|SWP_NOZORDER);

    // figure out the new height of the dialog
    ::GetClientRect(hdlg, &cr);
    dlgHgt = (cr.bottom - cr.top) + 1;
 
    // Reposition the OK and Cancel btns
    int okHgt = okRect.bottom - okRect.top + 1;
    ::SetWindowPos(okWnd, nullptr, okRect.left, dlgHgt-bottomGap-okHgt, 0, 0, 
                   SWP_NOSIZE|SWP_NOREDRAW|SWP_NOZORDER);

    HWND cancelWnd = ::GetDlgItem(hdlg, IDCANCEL);
    if (cancelWnd == nullptr) return 0L;

    RECT cancelRect;
    GetLocalRect(cancelWnd, cancelRect, hdlg);
    int cancelHgt = cancelRect.bottom - cancelRect.top + 1;
    ::SetWindowPos(cancelWnd, nullptr, cancelRect.left, dlgHgt-bottomGap-cancelHgt, 0, 0, 
                   SWP_NOSIZE|SWP_NOREDRAW|SWP_NOZORDER);

    // localize and initialize the groupbox and radiobuttons
    InitializeExtendedDialog(hdlg, howToEnableFrameUI);

    // Looks like we were able to extend the dialog
    gDialogWasExtended = true;
    return TRUE;
  }
  return 0L;
}