public function __construct() { parent::__construct(); $this->textEdit_static_text = tr('Downloading PQPack package'); $this->setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint | Qt::WindowTitleHint); $this->downloader = new PQFileDownloader(); $this->downloader->connect(SIGNAL('downloaded()'), $this, SLOT('downloaded()')); $this->downloader->connect(SIGNAL('downloadProgress(qint64,qint64)'), $this, SLOT('downloadProgress(qint64,qint64)')); $this->textEdit = new QTextEdit($this); $this->textEdit->html = $this->textEdit_static_text . '... (0Kb of 0Kb)'; $this->textEdit->readOnly = true; $this->textEdit->minimumHeight = $this->textEdit->maximumHeight = 80; $this->progressBar = new QProgressBar($this); $this->progressBar->setMinimumSize(450, 30); $this->button = new QPushButton($this); $this->button->text = tr('Continue'); $this->button->enabled = false; $this->button->connect(SIGNAL('clicked()'), $this, SLOT('close()')); $this->button->minimumHeight = 30; $layout = new QVBoxLayout(); $layout->addWidget($this->textEdit); $layout->addWidget($this->progressBar); $layout->addWidget($this->button); $this->setLayout($layout); }
public function __construct($objParentObject, $strFileUploadCallback, $strControlId = null) { // Call parent constructor and define FileUploadCallback parent::__construct($objParentObject, $strControlId); $this->strFileUploadCallback = $strFileUploadCallback; // Setup the Dialog Box, itself $this->strTemplate = __DOCROOT__ . __PHP_ASSETS__ . '/QFileAssetDialog.tpl.php'; //$this->blnDisplay = false; //$this->blnMatteClickable = false; $this->AutoOpen = false; $this->strTitle = QApplication::Translate("Upload a File"); // Controls for Upload FileAsset Dialog Box $this->lblMessage = new QLabel($this); $this->lblMessage->HtmlEntities = false; $this->lblError = new QLabel($this); $this->lblError->HtmlEntities = false; $this->flcFileAsset = new QFileControl($this); $this->btnUpload = new QButton($this); $this->btnCancel = new QButton($this); $this->objSpinner = new QWaitIcon($this); // Events on the Dialog Box Controls $this->flcFileAsset->AddAction(new QEnterKeyEvent(), new QTerminateAction()); $this->btnUpload->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnUpload)); $this->btnUpload->AddAction(new QClickEvent(), new QToggleEnableAction($this->btnCancel)); $this->btnUpload->AddAction(new QClickEvent(), new QToggleDisplayAction($this->objSpinner)); $this->btnUpload->AddAction(new QClickEvent(), new QServerControlAction($this, 'btnUpload_Click')); $this->btnCancel->AddAction(new QClickEvent(), new QHideDialog($this)); }
public function __construct($parent = 0) { parent::__construct($parent); $this->setWindowFlags(Qt::Window); $this->textEdit = new PQPlainTextEdit($this); $this->headerLabel1 = new QLabel($this); $this->setPHPEventListener($this, eventListener); $this->addPHPEventListenerType(QEvent::Close); $buttonsPanel = new QWidget($this); $cancelBtn = new QPushButton($buttonsPanel); $cancelBtn->text = tr('Cancel'); $cancelBtn->onClicked = function ($sender, $event) { $this->close(); }; $okBtn = new QPushButton($buttonsPanel); $okBtn->text = tr('OK'); $okBtn->onClicked = function ($sender, $event) { $this->done(1); }; $buttonsPanelLayout = new QHBoxLayout(); $buttonsPanelLayout->addWidget(new QWidget($buttonsPanel)); // распорка $buttonsPanelLayout->addWidget($cancelBtn); $buttonsPanelLayout->addWidget($okBtn); $buttonsPanelLayout->setMargin(0); $buttonsPanel->setLayout($buttonsPanelLayout); $layout = new QVBoxLayout(); $layout->addWidget($this->headerLabel1); $layout->addWidget($this->textEdit); $layout->addWidget($buttonsPanel); $this->setLayout($layout); }
public function __construct($strCloseCallback, $objParentObject, $strControlId = null) { parent::__construct($objParentObject, $strControlId); $this->strCloseCallback = $strCloseCallback; $this->DialogClass = $this->strCssClass; // Define local child controls $this->pnlValueDisplay = new QPanel($this); //$this->pnlValueDisplay->Text = '0'; $this->pnlValueDisplay->CssClass = 'calculator_display'; // Define the Proxy $this->pxyNumberControl = new QControlProxy($this); $this->pxyNumberControl->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyNumber_Click')); $this->pxyOperationControl = new QControlProxy($this); $this->pxyOperationControl->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyOperation_Click')); $this->btnEqual = new QButton($this); $this->btnEqual->Text = '='; $this->btnEqual->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEqual_Click')); $this->btnPoint = new QButton($this); $this->btnPoint->Text = '.'; $this->btnPoint->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnPoint_Click')); $this->btnClear = new QButton($this); $this->btnClear->Text = 'C'; $this->btnClear->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnClear_Click')); $this->btnUpdate = new QButton($this); $this->btnUpdate->Text = 'Save'; $this->btnUpdate->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnUpdate_Click')); $this->btnCancel = new QButton($this); $this->btnCancel->Text = 'Cancel'; $this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click')); }
public function __construct($objParentObject, $strControlId) { parent::__construct($objParentObject, $strControlId); $this->AutoRenderChildren = true; $this->Width = 700; $this->objModelConnectorOptions = new QModelConnectorOptions(); $this->tabs = new QTabs($this); $this->tabs->HeightStyle = "auto"; $this->AddButton('Save', 'save'); $this->AddButton('Save, Regenerate and Reload', 'saveRefresh'); $this->AddButton('Cancel', 'cancel'); $this->AddAction(new QDialog_ButtonEvent(), new QAjaxControlAction($this, 'ButtonClick')); }
public function __construct($events, $startIndex, $parent = 0) { parent::__construct($parent); $this->startIndex = $startIndex; /* $this->csPath = c(PQNAME)->csPath; $this->csEvents = c(PQNAME)->csEvents; $this->csName = c(PQNAME)->csName; $component = get_class($object); $events = array(); while ($component != null) { $componentPath = $this->csPath . "/$component/" . $this->csName; $eventsPath = $this->csPath . "/$component/" . $this->csEvents; $r = array(); if (file_exists($eventsPath) && is_file($eventsPath)) { require ($eventsPath); if (count($r) > 0) { $events[$component] = $r; } } $component = null; require($componentPath); if (isset($r['parent']) && !empty(trim($r['parent']))) { $component = $r['parent']; } } $list = new QListWidget($this); $list->alternatingRowColors = true; $list->connect(SIGNAL('itemDoubleClicked(int)'), $this, SLOT('itemDoubleClicked(int)')); foreach($events as $c => $e) { foreach($e as $event) { $list->addItem($event['event']); } }*/ $list = new QListWidget($this); $list->alternatingRowColors = true; $list->connect(SIGNAL('itemDoubleClicked(int)'), $this, SLOT('itemDoubleClicked(int)')); foreach ($events as $eventIndex => $event) { $list->addItem($event['event']); } }
public function __construct($fileName, QWidget $parent = NULL) { parent::__construct($parent); $fileInfo = new QFileInfo($fileName); $this->tabWidget = new QTabWidget(); $this->tabWidget->addTab(new GeneralTab($fileInfo), tr("General")); $this->tabWidget->addTab(new PermissionsTab($fileInfo), tr("Permissions")); $this->tabWidget->addTab(new ApplicationsTab($fileInfo), tr("Applications")); $this->buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); $this->connect($this->buttonBox, SIGNAL("accepted()"), $this, SLOT("accept()")); $this->connect($this->buttonBox, SIGNAL("rejected()"), $this, SLOT("reject()")); $mainLayout = new QVBoxLayout(); $mainLayout->addWidget($this->tabWidget); $mainLayout->addWidget($this->buttonBox); $this->setLayout($mainLayout); $this->setWindowTitle(tr("Tab Dialog")); }
function __construct() { parent::__construct(); $this->pendingAdditiveOperator = new QString(); $this->pendingMultiplicativeOperator = new QString(); $this->display = new QLineEdit("0"); $this->display->setReadOnly(true); $this->display->setAlignment(Qt::AlignRight); $this->display->setMaxLength(15); $this->display->installEventFilter($this); $font = $this->display->font(); $font->setPointSize($font->pointSize() + 8); $this->display->setFont($font); $digitColor = new QColor(150, 205, 205); $backspaceColor = new QColor(225, 185, 135); $memoryColor = new QColor(100, 155, 155); $operatorColor = new QColor(155, 175, 195); for ($i = 0; $i < Calculator::NumDigitButtons; ++$i) { $this->digitButtons[$i] = $this->createButton(tr($i), $digitColor, SLOT('digitClicked()')); } $this->pointButton = $this->createButton(tr("."), $digitColor, SLOT('pointClicked()')); $this->changeSignButton = $this->createButton(tr("±"), $digitColor, SLOT('changeSignClicked()')); $this->backspaceButton = $this->createButton(tr("Backspace"), $backspaceColor, SLOT('backspaceClicked()')); $this->clearButton = $this->createButton(tr("Clear"), $backspaceColor, SLOT('clear()')); $this->clearAllButton = $this->createButton(tr("Clear All"), $backspaceColor, SLOT('clearAll()')); $this->clearMemoryButton = $this->createButton(tr("MC"), $memoryColor, SLOT('clearMemory()')); $this->readMemoryButton = $this->createButton(tr("MR"), $memoryColor, SLOT('read_Memory()')); $this->setMemoryButton = $this->createButton(tr("MS"), $memoryColor, SLOT('setMemory()')); $this->addToMemoryButton = $this->createButton(tr("M+"), $memoryColor, SLOT('addToMemory()')); $this->divisionButton = $this->createButton(tr("÷"), $operatorColor, SLOT('multiplicativeOperatorClicked()')); $this->timesButton = $this->createButton(tr("×"), $operatorColor, SLOT('multiplicativeOperatorClicked()')); $this->minusButton = $this->createButton(tr("-"), $operatorColor, SLOT('additiveOperatorClicked()')); $this->plusButton = $this->createButton(tr("+"), $operatorColor, SLOT('additiveOperatorClicked()')); $this->squareRootButton = $this->createButton(tr("Sqrt"), $operatorColor, SLOT('unaryOperatorClicked()')); $this->powerButton = $this->createButton(tr("x²"), $operatorColor, SLOT('unaryOperatorClicked()')); $this->reciprocalButton = $this->createButton(tr("1/x"), $operatorColor, SLOT('unaryOperatorClicked()')); $this->equalButton = $this->createButton(tr("="), $operatorColor, SLOT('equalClicked()')); $this->mainLayout = new QGridLayout($this); $this->mainLayout->setSizeConstraint(QLayout::SetFixedSize); $this->mainLayout->addWidget($this->display, 0, 0, 1, 6); $this->mainLayout->addWidget($this->backspaceButton, 1, 0, 1, 2); $this->mainLayout->addWidget($this->clearButton, 1, 2, 1, 2); $this->mainLayout->addWidget($this->clearAllButton, 1, 4, 1, 2); $this->mainLayout->addWidget($this->clearMemoryButton, 2, 0); $this->mainLayout->addWidget($this->readMemoryButton, 3, 0); $this->mainLayout->addWidget($this->setMemoryButton, 4, 0); $this->mainLayout->addWidget($this->addToMemoryButton, 5, 0); for ($i = 1; $i < Calculator::NumDigitButtons; ++$i) { $row = ceil((8 - ($i + 1)) / 3) + 2; $column = ceil(($i - 1) % 3) + 1; $this->mainLayout->addWidget($this->digitButtons[$i], (int) $row, (int) $column); } $this->mainLayout->addWidget($this->digitButtons[0], 5, 1); $this->mainLayout->addWidget($this->pointButton, 5, 2); $this->mainLayout->addWidget($this->changeSignButton, 5, 3); $this->mainLayout->addWidget($this->divisionButton, 2, 4); $this->mainLayout->addWidget($this->timesButton, 3, 4); $this->mainLayout->addWidget($this->minusButton, 4, 4); $this->mainLayout->addWidget($this->plusButton, 5, 4); $this->mainLayout->addWidget($this->squareRootButton, 2, 5); $this->mainLayout->addWidget($this->powerButton, 3, 5); $this->mainLayout->addWidget($this->reciprocalButton, 4, 5); $this->mainLayout->addWidget($this->equalButton, 5, 5); $this->setLayout($this->mainLayout); $this->setWindowTitle(tr("Calculator")); }