Exemplo n.º 1
0
ConnSettings::ConnSettings(QWidget *parent) :
    QDialog(parent)
{
    setWindowTitle("Connection: <noname>");
    restoreGeometry(settings.value("SetDlgGeometry").toByteArray());
    setModal(false);
    setContentsMargins(1,1,1,1);
    initParamLayout();
    warning = new QLabel(this);
    warning->setText(
    "<b>WARNING</b> See for: <a href='http://libvirt.org/remote.html'><b>Libvirt Remote support</b></a>");
    warning->setOpenExternalLinks(true);
    initButtons();
    URI = new QTextEdit(this);
    URI->setReadOnly(true);
    commonLayout = new QVBoxLayout();
    commonLayout->addWidget(parameters);
    commonLayout->addWidget(warning);
    commonLayout->addWidget(URI);
    commonLayout->addWidget(buttons);
    commonLayout->insertStretch(-1);
    setLayout(commonLayout);
    initParameters();
    timerId = startTimer(1000);
}
Exemplo n.º 2
0
PPSlider::PPSlider(pp_int32 id, PPScreen* parentScreen, EventListenerInterface* eventListener, 
				   const PPPoint& location, pp_int32 size, 
				   bool horizontal, bool buttonSwap) :
	PPControl(id, parentScreen, eventListener, location, PPSize(0,0)),
	oneDimSize(size),
	horizontal(horizontal),
	buttonSwap(buttonSwap),
	controlCaughtByLMouseButton(false), controlCaughtByRMouseButton(false)
{
	// default color
	backgroundColor.r = 64;
	backgroundColor.g = 64;
	backgroundColor.b = 64;

	currentBarSize = 65536;
	currentBarPosition = 0;

	initButtons();
	
	caughtControl = NULL;

	minValue = 0;
	maxValue = 255;
	currentValue = 0;
}
Exemplo n.º 3
0
MainWidget::MainWidget(Settings *settings, QWidget *parent)
    : QWidget(parent)
    , m_settings(settings)
    , m_scene(-105, -175, 808, 533)
    , m_centralWidgetRect(355, 176, 808, 533)
    , gameField(new Game(m_centralWidgetRect, &m_scene))
    , about(new aboutWidget(m_centralWidgetRect))
    , menu(new mainMenu(m_centralWidgetRect))
    , manage(new manageWidget(m_centralWidgetRect))
    , st(new  QStackedWidget(this))
    , recordsView(new recordsWidget(m_centralWidgetRect))
    , m_settingsWidget(new SettingsWidget(m_centralWidgetRect, settings))
    , settings(new QSettings("karama", "WolfAndEggs", this))
    , isUpdated(false)
{
    loadSettings();
    recordsView->printRecords(gameField->getRecords());
    setWindowFlags(Qt::FramelessWindowHint);
    initStackedWidget();
    initButtons();
    showMaximized();

    QObject::connect(this,SIGNAL(pauseGame()),gameField,SLOT(pauseGame()));
    QObject::connect(recordsView->newBut,SIGNAL(clicked()),this,SLOT(newGameStart()));
}
Exemplo n.º 4
0
void setup_timer_buttons(void){
    init_button();
    init_systimer();
    initButtons();

    _enable_interrupts();
}
Exemplo n.º 5
0
EditPersonalInfosWidget::EditPersonalInfosWidget(QWidget* parent,const LinQedInClient* cl):EditInfosWidget(parent,
                                                                                                    tr("Modifica informazioni personali"),
                                                                                                    cl),
    infos(getProfile().getPersonalInformations()){
    setAttribute(Qt::WA_DeleteOnClose,true);
    formWidget=new QWidget;
    infosLayout=new QFormLayout;
    name=new QLineEdit; surname=new QLineEdit; birthplace=new QLineEdit; birthState=new QLineEdit;
    connect(name,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(surname,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(birthplace,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(birthState,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    infosLayout->addRow(tr("Nome: "),name); infosLayout->setAlignment(name,Qt::AlignCenter);
    infosLayout->addRow(tr("Cognome: "),surname); infosLayout->setAlignment(surname,Qt::AlignCenter);
    infosLayout->addRow(tr("Luogo di Nascita: "),birthplace); infosLayout->setAlignment(birthplace,Qt::AlignCenter);
    infosLayout->addRow(tr("Paese di Nascita: "),birthState); infosLayout->setAlignment(birthState,Qt::AlignCenter);
    initRadioButtons();
    infosLayout->addRow(tr("Sesso: "),genderBox); infosLayout->setAlignment(genderBox,Qt::AlignCenter);
    calendar=new QCalendarWidget;
    calendar->setGridVisible(true);
    calendar->setMinimumDate(QDate(1950,1,1));
    calendar->setMaximumDate(QDate::currentDate().addYears(-16)); //dai 16 anni in su
    calendar->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
    infosLayout->addRow(tr("Data di Nascita"),calendar);
    formWidget->setObjectName("form");
    formWidget->setStyleSheet("#form{"+GUIStyle::borderStyle()+"}");
    formWidget->setContentsMargins(10,10,10,10);
    formWidget->setLayout(infosLayout);
    addWidgetToMainLayout(formWidget,Qt::AlignCenter);
    initButtons();

    writeDefaultValues();
}//EditPersonalInfosWidget
void QWinThumbnailToolBarPrivate::_q_updateToolbar()
{
    updateScheduled = false;
    if (!pTbList || !window)
        return;
    THUMBBUTTON buttons[windowsLimitedThumbbarSize];
    initButtons(buttons);
    const int thumbbarSize = qMin(buttonList.size(), windowsLimitedThumbbarSize);
    // filling from the right fixes some strange bug which makes last button bg look like first btn bg
    for (int i = (windowsLimitedThumbbarSize - thumbbarSize); i < windowsLimitedThumbbarSize; i++) {
        QWinThumbnailToolButton *button = buttonList.at(i - (windowsLimitedThumbbarSize - thumbbarSize));
        buttons[i].dwFlags = static_cast<THUMBBUTTONFLAGS>(makeNativeButtonFlags(button));
        buttons[i].dwMask  = static_cast<THUMBBUTTONMASK>(makeButtonMask(button));
        if (!button->icon().isNull()) {;
            buttons[i].hIcon = QtWin::toHICON(button->icon().pixmap(GetSystemMetrics(SM_CXSMICON)));
            if (!buttons[i].hIcon)
                buttons[i].hIcon = (HICON)LoadImage(0, IDI_APPLICATION, IMAGE_ICON, SM_CXSMICON, SM_CYSMICON, LR_SHARED);
        }
        if (!button->toolTip().isEmpty()) {
            buttons[i].szTip[button->toolTip().left(sizeof(buttons[i].szTip)/sizeof(buttons[i].szTip[0]) - 1).toWCharArray(buttons[i].szTip)] = 0;
        }
    }
    HRESULT hresult = pTbList->ThumbBarUpdateButtons(reinterpret_cast<HWND>(window->winId()), windowsLimitedThumbbarSize, buttons);
    if (FAILED(hresult))
        qWarning() << msgComFailed("ThumbBarUpdateButtons", hresult);
    freeButtonResources(buttons);
}
Exemplo n.º 7
0
EditStudiesInfosWidget::EditStudiesInfosWidget(const LinQedInClient* cl,QWidget* parent):EditInfosWidget(parent,
                                                                                                    tr("Modifica informazioni di studio"),
                                                                                                    cl){
    setAttribute(Qt::WA_DeleteOnClose);
    try{
        infos=dynamic_cast<const Studies*>(&getProfile().getInformationsBySectionName(Studies::getIDString()));
    }catch(const NoInfoException&){infos=0;}
    formWidget=new QFrame;
    form=new QFormLayout;
    highSchool=new QLineEdit; qualification=new QLineEdit;
    connect(highSchool,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    connect(qualification,SIGNAL(returnPressed()),this,SLOT(saveRequest()));
    form->addRow(tr("Scuola Superiore: "),highSchool); form->setAlignment(highSchool,Qt::AlignCenter);
    form->addRow(tr("Qualificazione Professionale: "),qualification); form->setAlignment(qualification,Qt::AlignCenter);
    initDegrees();

    noDegree=new QLabel(noDegreeS);
    noDegree->setStyleSheet(GUIStyle::errorLabelStyle());
    form->addWidget(noDegree); form->setAlignment(noDegree,Qt::AlignCenter);

    addDegree=new QPushButton(tr("Aggiungi Laurea"));
    addDegree->setCursor(QCursor(Qt::PointingHandCursor));
    form->addWidget(addDegree); form->setAlignment(addDegree,Qt::AlignCenter);
    connect(addDegree,SIGNAL(clicked()),this,SLOT(addRow()));

    formWidget->setLayout(form);
    addWidgetToMainLayout(formWidget,Qt::AlignCenter);
    initButtons();
    formWidget->setObjectName("form");
    formWidget->setStyleSheet("#form{"+GUIStyle::borderStyle()+"padding-left:10px;padding-top:10px;}");
    writeDefaultValues();
}//EditStudiesInfosWidget
Exemplo n.º 8
0
void UILayer::onEnter( void )
{
    TouchLayer::onEnter();
    
    initDecoration(); //기능없는 UI
    initButtons();    //기능있는 UI
}
Exemplo n.º 9
0
CMainWindow::CMainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::CMainWindow),
	_controller(new CController),
	_currentFileList(0),
	_otherFileList(0),
	_quickViewActive(false)
{
	assert_r(!_instance);
	_instance = this;
	ui->setupUi(this);

	connect(qApp, &QApplication::focusChanged, this, &CMainWindow::focusChanged);

	_controller->pluginProxy().setToolMenuEntryCreatorImplementation(CPluginProxy::CreateToolMenuEntryImplementationType(std::bind(&CMainWindow::createToolMenuEntries, this, std::placeholders::_1)));

	_currentFileList = ui->leftPanel;
	_otherFileList   = ui->rightPanel;

	connect(ui->leftPanel->fileListView(),  &CFileListView::ctrlEnterPressed, this, &CMainWindow::pasteCurrentFileName);
	connect(ui->rightPanel->fileListView(), &CFileListView::ctrlEnterPressed, this, &CMainWindow::pasteCurrentFileName);
	connect(ui->leftPanel->fileListView(),  &CFileListView::ctrlShiftEnterPressed, this, &CMainWindow::pasteCurrentFilePath);
	connect(ui->rightPanel->fileListView(), &CFileListView::ctrlShiftEnterPressed, this, &CMainWindow::pasteCurrentFilePath);

	connect(ui->leftPanel, &CPanelWidget::currentItemChangedSignal, this, &CMainWindow::currentItemChanged);
	connect(ui->rightPanel, &CPanelWidget::currentItemChangedSignal, this, &CMainWindow::currentItemChanged);

	connect(ui->leftPanel, &CPanelWidget::itemActivated, this, &CMainWindow::itemActivated);
	connect(ui->rightPanel, &CPanelWidget::itemActivated, this, &CMainWindow::itemActivated);

	ui->leftPanel->fileListView()->addEventObserver(this);
	ui->rightPanel->fileListView()->addEventObserver(this);

	initButtons();
	initActions();

	ui->leftPanel->setPanelPosition(LeftPanel);
	ui->rightPanel->setPanelPosition(RightPanel);

	ui->fullPath->clear();

	QSplitterHandle * handle = ui->splitter->handle(1);
	handle->setContextMenuPolicy(Qt::CustomContextMenu);
	connect(handle, &QSplitterHandle::customContextMenuRequested, this, &CMainWindow::splitterContextMenuRequested);

	connect(ui->commandLine, &CHistoryComboBox::itemActivated, this, &CMainWindow::executeCommand);

	_commandLineCompleter.setCaseSensitivity(Qt::CaseInsensitive);
	_commandLineCompleter.setCompletionMode(QCompleter::InlineCompletion);
	_commandLineCompleter.setCompletionColumn(NameColumn);
	ui->commandLine->setCompleter(&_commandLineCompleter);
	ui->commandLine->setClearEditorOnItemActivation(true);

	ui->leftWidget->setCurrentIndex(0); // PanelWidget
	ui->rightWidget->setCurrentIndex(0); // PanelWidget

	connect(&_uiThreadTimer, &QTimer::timeout, this, &CMainWindow::uiThreadTimerTick);
	_uiThreadTimer.start(5);
}
Exemplo n.º 10
0
void AlarmWidget::initMainWindow()
{
    initTimerBoxes();
    initButtons();
    initRadioButtons();
    initLayouts();
    tuneMainWindow();
}
Exemplo n.º 11
0
// SoundView
//---------------------------------------------------------------------------
SoundView::SoundView() : OptionsTemplateView()
{
    setSearchName("SoundView");
    setTitle("Sound Options");

    initButtons();

} // end SoundView::SoundView
Exemplo n.º 12
0
void PopupPurchase::onEnter()
{
    PopupBase::onEnter();
    
    initButtons();
    
    
}
Exemplo n.º 13
0
void GameUI::init()
{
	background = { 0.7f, 0.7f, 0.8f, 0.8f };
	font = { 0.1f, 0.1f, 0.1f, 1 };
	activeTab = ActiveTab::BuildingTab;

	map = new MiniMap();
	initButtons();
}
// OptionsTemplateView
//---------------------------------------------------------------------------
OptionsTemplateView::OptionsTemplateView() : MenuTemplateView()
{
    setSearchName("OptionsView");
    setTitle("OptionsTemplate");
    setSubTitle("");

    initButtons();

} // end OptionsTemplateView::OptionsTemplateView
Exemplo n.º 15
0
// ControlsView
//---------------------------------------------------------------------------
ControlsView::ControlsView() : OptionsTemplateView()
{
    setSearchName("ControlsView");
    setTitle("Control Options");
    setSubTitle("");

    initButtons();

} // end ControlsView::ControlsView
Exemplo n.º 16
0
void CreaturePurchaseCard::initView()
{
	picture = std::make_shared<CCreaturePic>(pos.x, pos.y, creatureOnTheCard);
	background = std::make_shared<CPicture>("QuickRecruitmentWindow/CreaturePurchaseCard.png", pos.x-4, pos.y-50);
	initAmountInfo();
	initSlider();
	initButtons();
	initCostBox();
}
// InterfaceView
//---------------------------------------------------------------------------
InterfaceView::InterfaceView() : OptionsTemplateView()
{
    setSearchName("InterfaceView");
    setTitle("Interface Options");
    setSubTitle("");

    initButtons();

} // end InterfaceView::InterfaceView
void MainWindow::setButtons()
{
    deactiveButton(Osc1);
    deactiveButton(Osc2);
    deactiveButton(Lfo);
    deactiveButton(Filter);
    deactiveButton(Power);

    initButtons();
}
Exemplo n.º 19
0
//----------------------------------
// MantidWSIndexDialog private methods
//----------------------------------
void MantidWSIndexDialog::init()
{
  m_outer = new QVBoxLayout;

  setWindowTitle(tr("MantidPlot"));
  initSpectraBox();
  initWorkspaceBox();
  initButtons();
  setLayout(m_outer);
}
Exemplo n.º 20
0
gui::ToolBox::ToolBox(const Gtk::Image& original, Gtk::Image& current) :
		Gtk::Frame(FRAME_LABEL), buttonBox_(Gtk::ORIENTATION_VERTICAL), imageOriginal_(
				original), imageCurrent_(current) {
	set_border_width(BORDER_WIDTH);
	histogramWindow_ = nullptr;
	initButtons();
	connectAll();
	addAll();
	show_all_children();
}
void QWinThumbnailToolBarPrivate::clearToolbar()
{
    if (!pTbList || !window)
        return;
    THUMBBUTTON buttons[windowsLimitedThumbbarSize];
    initButtons(buttons);
    HRESULT hresult = pTbList->ThumbBarUpdateButtons(reinterpret_cast<HWND>(window->winId()), windowsLimitedThumbbarSize, buttons);
    if (FAILED(hresult))
        qWarning() << msgComFailed("ThumbBarUpdateButtons", hresult);
}
Exemplo n.º 22
0
void PPSlider::setLocation(const PPPoint& location)
{
	PPControl::setLocation(location);
	
	delete backgroundButton;	
	delete buttonUp;
	delete buttonDown;
	delete buttonBar;

	initButtons();
}
Exemplo n.º 23
0
// VisualsView
//---------------------------------------------------------------------------
VisualsView::VisualsView() : OptionsTemplateView()
{
    setSearchName("VisualsView");
    setTitle("Visual Options");
    setSubTitle("");

    selectedColorStartY = 0;

    initButtons();

} // end VisualsView::VisualsView
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    version = 1;
    factor = 10000;
    ui->setupUi(this);
    initButtons();
    initSliders();
//    onPlayerCallback();
}
Exemplo n.º 25
0
void setup() {
	lcd.print("LOADING");

	lcd.begin(20, 4);
	sensorManager.init();
	initButtons();
	Serial.begin(9600);
	setSyncProvider(RTC.get);

	EEPROM_readAnything(0, altitude);
}
Exemplo n.º 26
0
/** \brief the main function of the project
 *  check current state and switch apps respectively
 * \param 
 * \param 
 * \return 
 *
 */     
int main(void)
{
    /* Chip errata */
    CHIP_Init();

    /* If first word of user data page is non-zero, enable eA Profiler trace */
    BSP_TraceProfilerSetup();

    ////////////////////////////////////////////////////////////////////////
    setupSWO();
    /* Initialize LED driver */
    BSP_LedsInit();
    initButtons();
    initClock();
    initActivity();
    initVariables();
    SegmentLCD_Init(false);  /* Enable LCD without voltage boost */

    state = main_screen;

    /* Infinite blink loop */
    while (1)
    {
        //NOTE maybe button A(change state) must be checked here
        if(screen_notification == true)    // don't update screen until user reaction
        {
            EMU_EnterEM2(true);
            button = NO_BUTTON;
        }
        else
        {
            switch (state)
            {
            case main_screen:
                mainScreenApp();
                break;
            case pomodoro_screen:
                pomodoroApp();
                break;
            case activity_screen:
                activityApp();
                break;
            case time_setup_screen:
                setupTimeApp();
                break;
            case alarm_setup_screen:
                setupAlarmApp();
                break;
            }
        }
    }
}
Exemplo n.º 27
0
void initAll(){
	SysTick_Config(SystemCoreClock / 1000);
	lcd_init();
    lcd_home();
	lcd_cls();
	initPWM(PWM_TIME_PERIOD);
	setServoAngle(0,0);
	UARTInit(BAUD_RATE);
	ds1307Init();
	eeprom_24aaInit();
	eeprom24aaMemoryCheck();
	initButtons();
}
Exemplo n.º 28
0
// Loads initial interface data
void initInterface()
{
	FILE *hud;			// config file
	Sprite *temp;
	SDL_Surface *menu;

	// Open the config file, load defaults if it fails
	hud = fopen("config/hud.txt","r");
	if(hud == NULL)
	{
		fprintf(stderr,"HUD.txt failed to open, using defaults\n");
		loadDefHUD();
	}

	else
	{
		loadHUD(hud);
	}

	// Load menu sprite
	temp = LoadSprite("hud/menu.png",640,480);
	menu = IMG_Load("hud/menu.png");
	SDL_SetColorKey(menu, 0, 0);
	temp->image = SDL_DisplayFormatAlpha(menu);
	SDL_FreeSurface(menu);

	// set HUD transparency slider info
	aSlider.x = ORIGIN_X + 65;
	aSlider.y = ORIGIN_Y - 180;
	aSlider.w = 50;
	aSlider.h = 24;
	aSlide = false;

	// set scroll speed slider info
	sSlider.x = ORIGIN_X + 65;
	sSlider.y = ORIGIN_Y - 180;
	sSlider.w = 50;
	sSlider.h = 24;
	HUD.sSlide = false;
	
	// start invisible
	alpha = SDL_ALPHA_TRANSPARENT;
	
	// Load button info
	initButtons();

	HUD.grabPanel = 0;
	HUD.menu = 1;
	HUD.ttips = true;
}
Exemplo n.º 29
0
NoiseGen::NoiseGen()
{

    //init seed
    srand( time(NULL) );

    IMAGE_SIZE = 256;
    IMAGE_SCALE = 2;

    terrainmode = false;
    //paramvalues.resize(9);
    terSlider = NULL;

    //load settings
    defaultSettings(); // load hardcoded defaults first
    loadSettings(); // load settings file, if one is not found, create one

    //init screen
    screen = new sf::RenderWindow( sf::VideoMode(IMAGE_SIZE*IMAGE_SCALE+RIGHT_MARGIN_WIDTH,IMAGE_SIZE*IMAGE_SCALE+BOTTOM_MARGIN_HEIGHT,32), "Simplex Noise");
    screen->setIcon(sfml_icon.width, sfml_icon.height, sfml_icon.pixel_data);
    mapTexture = new sf::RenderTexture;
    mapTexture->create(IMAGE_SCALE*IMAGE_SIZE, IMAGE_SCALE*IMAGE_SIZE);
    mapTexture->display();

    //load font
    font.loadFromFile("font.ttf");



    //init terrain colors
    /*
    terraincolors.push_back(sf::Color(0,0,120)); // deep water
    terraincolors.push_back(sf::Color(0,0,220)); // shallow water
    terraincolors.push_back(sf::Color(200,200,0)); // sand
    terraincolors.push_back(sf::Color(200,120,50)); // dirt
    terraincolors.push_back(sf::Color(0,220,0)); // low grass
    terraincolors.push_back(sf::Color(0,120,0)); // high grass
    terraincolors.push_back(sf::Color(120,120,120)); // low mtn
    terraincolors.push_back(sf::Color(200,200,200)); // high mtn
    terraincolors.push_back(sf::Color(245,245,245)); // mtn tops
    */

    //other object inits
    initSliders();
    initTerrainSlider();
    initButtons();

    //start main loop
    mainLoop();
}
Exemplo n.º 30
0
int main(void) {
    initLEDs();
    initButtons();

    while (1) {
        if (isButtonPressed(SB2)) {
            turnOffLEDs();
        } else {
            checkLEDsSettingButtons();
        }
        _delay_ms(50);
    }
    return 0;
}