示例#1
0
void MembersBox::prepare() {
	setTitle(lang(_filter == MembersFilter::Recent ? lng_channel_members : lng_channel_admins));

	_inner = setInnerWidget(object_ptr<Inner>(this, _channel, _filter), st::boxLayerScroll);

	setDimensions(st::boxWideWidth, st::boxMaxListHeight);
	addButton(lang(lng_close), [this] { closeBox(); });
	if (_channel->amCreator() && (_channel->membersCount() < (_channel->isMegagroup() ? Global::MegagroupSizeMax() : Global::ChatSizeMax()) || (!_channel->isMegagroup() && !_channel->isPublic()) || _filter == MembersFilter::Admins)) {
		addLeftButton(lang((_filter == MembersFilter::Admins) ? lng_channel_add_admin : lng_channel_add_members), [this] { onAdd(); });
	}

	connect(_inner, SIGNAL(mustScrollTo(int, int)), this, SLOT(onScrollToY(int, int)));

	_loadTimer.create(this);
	connect(_loadTimer, SIGNAL(timeout()), _inner, SLOT(load()));
}
示例#2
0
void KMInstancePage::initActions()
{
    addButton(i18n("New..."), "filenew", SLOT(slotNew()));
    addButton(i18n("Copy..."), "editcopy", SLOT(slotCopy()));
    addButton(i18n("Remove"), "edittrash", SLOT(slotRemove()));
    m_buttons.append(0);
    addButton(i18n("Set as Default"), "exec", SLOT(slotDefault()));
    addButton(i18n("Settings"), "configure", SLOT(slotSettings()));
    m_buttons.append(0);
    addButton(i18n("Test..."), "fileprint", SLOT(slotTest()));
}
SaveSlots::SaveSlots() : Menu(NULL, NULL)
{
	addButton(new UIButton("SaveSlot1Button"));
	addButton(new UIButton("SaveSlot2Button"));
	addButton(new UIButton("SaveSlot3Button"));
	addButton(new UIButton("SaveSlot4Button"));
	addButton(new UIButton("SaveSlot5Button"));
	addButton(new UIButton("SaveSlot6Button"));

	m_Load = LOAD; //creates a default state
}
ActionIconBtnPanel::ActionIconBtnPanel(GuiManager * manager)
    : GuiIconButtonPanel(manager, 5)
{
   m_fullAttack   = addButton( IDC_FULL_ATTACK, "icons2", "temp1", "Full Attack" );
   m_stdAttack = addButton(IDC_STD_ATTACK, "icons2", "temp2", "Attack");

   m_stdMove = addButton(IDC_MOVE, "icons2", "temp3", "Move");
   m_fiveFootStep = addButton(IDC_5_FOOT_STEP, "icons2", "temp4", "5 Foot Step");

   m_attemptFeint = addButton( IDC_FEINT , "icons2", "temp5", "Feint" );
   m_totalDefence = addButton( IDC_TOTAL_DEFENCE ,"icons2", "temp6", "Defence" );

   m_disarm = addButton( IDC_DISARM, "icons2", "temp7","Disarm" );
   m_trip = addButton( IDC_TRIP, "icons2", "temp8","Trip" );

   m_trip = addButton( IDC_END_TURN, "icons2", "temp9","End Turn" );


   // Register for turn action event updates
   registerEIListener(EIEventType::ACTION_UPDATE,
            std::bind(&ActionIconBtnPanel::onActionUpdate, this, std::placeholders::_1));
}
示例#5
0
void Quests::addButtons() {
	_iconSprites.load("quest.icn");


	addButton(Common::Rect(12, 109, 36, 129), Common::KEYCODE_i, &_iconSprites);
	addButton(Common::Rect(80, 109, 104, 129), Common::KEYCODE_q, &_iconSprites);
	addButton(Common::Rect(148, 109, 172, 129), Common::KEYCODE_a, &_iconSprites);
	addButton(Common::Rect(216, 109, 240, 129), Common::KEYCODE_UP, &_iconSprites);
	addButton(Common::Rect(250, 109, 274, 129), Common::KEYCODE_DOWN, &_iconSprites);
	addButton(Common::Rect(284, 109, 308, 129), Common::KEYCODE_ESCAPE, &_iconSprites);
}
示例#6
0
FontDialogPanel::FontDialogPanel(QWidget *parent)
    : QWidget(parent)
    , m_fontFamilyBox(new QFontComboBox)
    , m_fontSizeBox(new QDoubleSpinBox)
    , m_noButtons(new QCheckBox(tr("Don't display OK/Cancel buttons")))
    , m_dontUseNativeDialog(new QCheckBox(tr("Don't use native dialog")))
    , m_scalableFilter(new QCheckBox(tr("Filter scalable fonts")))
    , m_nonScalableFilter(new QCheckBox(tr("Filter non scalable fonts")))
    , m_monospacedFilter(new QCheckBox(tr("Filter monospaced fonts")))
    , m_proportionalFilter(new QCheckBox(tr("Filter proportional fonts")))
{
    // Options
    QGroupBox *optionsGroupBox = new QGroupBox(tr("Options"), this);
    QVBoxLayout *optionsLayout = new QVBoxLayout(optionsGroupBox);
    optionsLayout->addWidget(m_noButtons);
    optionsLayout->addWidget(m_dontUseNativeDialog);
    optionsLayout->addWidget(m_scalableFilter);
    optionsLayout->addWidget(m_nonScalableFilter);
    optionsLayout->addWidget(m_monospacedFilter);
    optionsLayout->addWidget(m_proportionalFilter);

    // Font
    QGroupBox *fontGroupBox = new QGroupBox(tr("Font"), this);
    QHBoxLayout *fontLayout = new QHBoxLayout(fontGroupBox);
    fontLayout->addWidget(m_fontFamilyBox);
    fontLayout->addWidget(m_fontSizeBox);
    m_fontSizeBox->setValue(QFont().pointSizeF());

    // Buttons
    QGroupBox *buttonsGroupBox = new QGroupBox(tr("Show"));
    QVBoxLayout *buttonsLayout = new QVBoxLayout(buttonsGroupBox);
    addButton(tr("Exec modal"), buttonsLayout, this, SLOT(execModal()));
    addButton(tr("Show modal"), buttonsLayout, this, SLOT(showModal()));
    m_deleteModalDialogButton =
        addButton(tr("Delete modal"), buttonsLayout, this, SLOT(deleteModalDialog()));
    addButton(tr("Show non-modal"), buttonsLayout, this, SLOT(showNonModal()));
    m_deleteNonModalDialogButton =
        addButton(tr("Delete non-modal"), buttonsLayout, this, SLOT(deleteNonModalDialog()));
    addButton(tr("Restore defaults"), buttonsLayout, this, SLOT(restoreDefaults()));
    buttonsLayout->addStretch();

    // Main layout
    QHBoxLayout *mainLayout = new QHBoxLayout(this);
    QVBoxLayout *leftLayout = new QVBoxLayout;
    leftLayout->addWidget(optionsGroupBox);
    leftLayout->addWidget(fontGroupBox);
    leftLayout->addStretch();
    mainLayout->addLayout(leftLayout);
    mainLayout->addWidget(buttonsGroupBox);

    enableDeleteModalDialogButton();
    enableDeleteNonModalDialogButton();
    restoreDefaults();
}
示例#7
0
ECLogicInput::ECLogicInput( ICNDocument *icnDocument, bool newItem, const char *id )
	: Component( icnDocument, newItem, (id) ? id : "logic_input" )
{
	m_name = i18n("Logic Input");
	setSize( -8, -8, 16, 16 );
	
	b_state = false;
	addButton( "button", QRect( -24, -8, 16, 16 ), "", true );
	
	createProperty( "useToggle", Variant::Type::Bool );
	property("useToggle")->setCaption( i18n("Use Toggle") );
	property("useToggle")->setValue(true);

	init1PinRight();
	
	m_pOut = createLogicOut( m_pPNode[0], false );
}
示例#8
0
int AMMessageBoxWTimeout::execWTimeout() {
    timeoutCountdownButton_->setText(QString("This message will close in %1").arg(timoutCountdown_/1000));
    addButton(timeoutCountdownButton_, QMessageBox::ResetRole);

    timeoutTimer_ = new QTimer();
    timeoutTimer_->setSingleShot(true);
    timeoutTimer_->setInterval(mSecTimeout_);
    connect(timeoutTimer_, SIGNAL(timeout()), this, SLOT(onTimeout()));
    timeoutTimer_->start();

    timeoutCountdownTimer_ = new QTimer();
    timeoutCountdownTimer_->setInterval(1000);
    connect(timeoutCountdownTimer_, SIGNAL(timeout()), this, SLOT(onTimeoutCountdown()));
    timeoutCountdownTimer_->start();

    return QMessageBox::exec();
}
示例#9
0
void BookmarkView::rangeBranchSelection() {
    clearButtons();
    hideProps();
    
    m_labelText->SetValue(wxT(""));
    m_labelText->Show();
    m_labelLabel->Show();

    showProps();

    addButton(m_buttonPanel, "Add Active Range", wxCommandEventHandler( BookmarkView::onAddRange ));
    
    showButtons();
    refreshLayout();
    
    this->Layout();
}
示例#10
0
ColorDialogPanel::ColorDialogPanel(QWidget *parent)
    : QWidget(parent)
    , m_colorComboBox(new QComboBox)
    , m_showAlphaChannel(new QCheckBox(tr("Show alpha channel")))
    , m_noButtons(new QCheckBox(tr("Don't display OK/Cancel buttons")))
    , m_dontUseNativeDialog(new QCheckBox(tr("Don't use native dialog")))
{
    // Options
    QGroupBox *optionsGroupBox = new QGroupBox(tr("Options"), this);
    QVBoxLayout *optionsLayout = new QVBoxLayout(optionsGroupBox);
    optionsLayout->addWidget(m_showAlphaChannel);
    optionsLayout->addWidget(m_noButtons);
    optionsLayout->addWidget(m_dontUseNativeDialog);

    // Color
    QGroupBox *colorGroupBox = new QGroupBox(tr("Color"), this);
    QVBoxLayout *colorLayout = new QVBoxLayout(colorGroupBox);
    colorLayout->addWidget(m_colorComboBox);
    m_colorComboBox->addItems(svgColorNames());
    m_colorComboBox->setEditable(true);

    QAbstractItemModel *sourceModel = m_colorComboBox->model();
    ColorProxyModel* proxyModel = new ColorProxyModel(m_colorComboBox);
    proxyModel->setSourceModel(sourceModel);
    sourceModel->setParent(proxyModel);
    m_colorComboBox->setModel(proxyModel);

    // Buttons
    QGroupBox *buttonsGroupBox = new QGroupBox(tr("Show"));
    QVBoxLayout *buttonsLayout = new QVBoxLayout(buttonsGroupBox);
    addButton(tr("Exec modal"), buttonsLayout, this, SLOT(execModal()));
    addButton(tr("Show modal"), buttonsLayout, this, SLOT(showModal()));
    m_deleteModalDialogButton =
        addButton(tr("Delete modal"), buttonsLayout, this, SLOT(deleteModalDialog()));
    addButton(tr("Show non-modal"), buttonsLayout, this, SLOT(showNonModal()));
    m_deleteNonModalDialogButton =
        addButton(tr("Delete non-modal"), buttonsLayout, this, SLOT(deleteNonModalDialog()));
    addButton(tr("Restore defaults"), buttonsLayout, this, SLOT(restoreDefaults()));
    buttonsLayout->addStretch();

    // Main layout
    QHBoxLayout *mainLayout = new QHBoxLayout(this);
    QVBoxLayout *leftLayout = new QVBoxLayout;
    leftLayout->addWidget(optionsGroupBox);
    leftLayout->addWidget(colorGroupBox);
    leftLayout->addStretch();
    mainLayout->addLayout(leftLayout);
    mainLayout->addWidget(buttonsGroupBox);

    enableDeleteModalDialogButton();
    enableDeleteNonModalDialogButton();
    restoreDefaults();
}
示例#11
0
void FindFadLineEdit::init()
{
    menuOptions = new QMenu( this );
    actionCaseSensitive = new QAction( this );
    actionWholeWords = new QAction( this );
    actionRegExp = new QAction( this );

    menuOptions->addAction( actionCaseSensitive );
    menuOptions->addAction( actionWholeWords );
    menuOptions->addAction( actionRegExp );

    tButtonOptions.setCursor( Qt::ArrowCursor );
    tButtonOptions.setFocusPolicy( Qt::NoFocus );
    tButtonOptions.setStyleSheet( "QToolButton { border: none; }" );
    tButtonOptions.setToolButtonStyle( Qt::ToolButtonIconOnly );
    tButtonOptions.setIconSize( QSize( 17, 17 ) );
    tButtonOptions.setToolTip( tr( "Options" ) );
    tButtonOptions.setStatusTip( tr( "Options" ) );
    tButtonOptions.setWhatsThis( tr( "Options" ) );
    connect( &tButtonOptions, SIGNAL( clicked() ), SLOT( invokeShowOptions() ) );

    addButton( &tButtonOptions, Left );

    actionCaseSensitive->setText( tr( "Case sensitive" ) );
    actionCaseSensitive->setCheckable( true );
    actionCaseSensitive->setIcon( QIcon( ":/casesensitively" ) );

    actionWholeWords->setText( tr( "Whole words" ) );
    actionWholeWords->setCheckable( true );
    actionWholeWords->setIcon( QIcon( ":/wholewords" ) );

    actionRegExp->setText( tr( "Use regular expression" ) );
    actionRegExp->setCheckable( true );
    actionRegExp->setIcon( QIcon( ":/regexp" ) );

    QActionGroup * findActionGroup = new QActionGroup( this );
    findActionGroup->setExclusive( false );
    findActionGroup->addAction( actionCaseSensitive );
    findActionGroup->addAction( actionWholeWords );
    findActionGroup->addAction( actionRegExp );

    connect( findActionGroup, SIGNAL( triggered(QAction*) ), SLOT( invokeFindFlagsChanged() ) );

    updateIcons();
}
示例#12
0
void BookmarkView::groupSelection(std::string groupName) {
    
    clearButtons();
    
    hideProps();
    
    m_labelText->SetValue(groupName);
    
    m_labelText->Show();
    m_labelLabel->Show();
    
    addButton(m_buttonPanel, "Remove Group", wxCommandEventHandler( BookmarkView::onRemoveGroup ));
    
    showProps();
    
    showButtons();
    refreshLayout();
}
示例#13
0
文件: pmquery.cpp 项目: DundalkIT/pcp
void PmQuery::addButtons(char *string) // comma-separated label:exitcode string
{
    char *n;
    QString pairs(string);
    static int next = 100;

    QStringList list = pairs.split(",");
    for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) {
	QString name = (*it).section(":", 0, 0);
	QString code = (*it).section(":", 1, 1);
	if (!name.isEmpty()) {
	    int sts = code.isEmpty() ? ++next : code.toInt();
	    if ((n = strdup(name.toLatin1().data())) == NULL)
		nomem();
	    addButton(n, false, sts);
	}
    }
}
示例#14
0
void AutoLockBox::prepare() {
	setTitle(lang(lng_passcode_autolock));

	addButton(lang(lng_box_ok), [this] { closeBox(); });

	int opts[] = { 60, 300, 3600, 18000 }, cnt = sizeof(opts) / sizeof(opts[0]);
	auto y = st::boxOptionListPadding.top();
	_options.reserve(cnt);
	for (auto i = 0; i != cnt; ++i) {
		auto v = opts[i];
		_options.push_back(new Ui::Radiobutton(this, qsl("autolock"), v, (v % 3600) ? lng_passcode_autolock_minutes(lt_count, v / 60) : lng_passcode_autolock_hours(lt_count, v / 3600), (Global::AutoLock() == v), st::langsButton));
		_options.back()->move(st::boxPadding.left() + st::boxOptionListPadding.left(), y);
		y += _options.back()->heightNoMargins() + st::boxOptionListSkip;
		connect(_options.back(), SIGNAL(changed()), this, SLOT(onChange()));
	}

	setDimensions(st::langsWidth, st::boxOptionListPadding.top() + cnt * st::langsButton.height + (cnt - 1) * st::boxOptionListSkip + st::boxOptionListPadding.bottom() + st::boxPadding.bottom());
}
void ActionsWidget::refreshButtons() {
	auto buttons = base::take(_buttons);
	for_const (auto &button, buttons) {
		delete button;
	}
	_blockUser = _leaveChannel = nullptr;

	if (auto user = peer()->asUser()) {
		if ((_hasBotHelp = hasBotCommand(qsl("help")))) {
			addButton(lang(lng_profile_bot_help), SLOT(onBotHelp()));
		}
		if ((_hasBotSettings = hasBotCommand(qsl("settings")))) {
			addButton(lang(lng_profile_bot_settings), SLOT(onBotSettings()));
		}
		addButton(lang(lng_profile_clear_history), SLOT(onClearHistory()));
		addButton(lang(lng_profile_delete_conversation), SLOT(onDeleteConversation()));
		if (user->botInfo) {
			addButton(lang(lng_profile_report), SLOT(onReport()), st::defaultLeftOutlineButton, st::profileBlockOneLineSkip);
		}
		refreshBlockUser();
	} else if (auto chat = peer()->asChat()) {
		if (chat->amCreator()) {
			addButton(lang(lng_profile_migrate_button), SLOT(onUpgradeToSupergroup()));
		}
		addButton(lang(lng_profile_clear_history), SLOT(onClearHistory()));
		addButton(lang(lng_profile_clear_and_exit), SLOT(onDeleteConversation()));
	} else if (auto channel = peer()->asChannel()) {
		if (!channel->amCreator() && (!channel->isMegagroup() || channel->isPublic())) {
			addButton(lang(lng_profile_report), SLOT(onReport()));
		}
		refreshDeleteChannel();
		refreshLeaveChannel();
	}

	refreshVisibility();
}
示例#16
0
FlowContainer::FlowContainer( ICNDocument *_icnDocument, bool newItem, const QString &id )
	: FlowPart( _icnDocument, newItem, id )
{
	m_ext_in = m_int_in = m_int_out = m_ext_out = 0l;
	b_expanded = true;
	
	addButton( "expandBtn", QRect( offsetX(), offsetY()+24 - 11, 22, 22 ), KIcon( "go-down" ), true );
	m_rectangularOverlay = new RectangularOverlay( this, 8, 8 );
	setSize( -160, -120, 320, 240 );
	
	
	m_int_in = (FPNode*)createNode( width()/2, 8+topStrip, 90, "int_in", Node::fp_out );
	m_int_out = (FPNode*)createNode( width()/2, height()-8-botStrip, 270, "int_out", Node::fp_in );
	
	button("expandBtn")->setState(true);
	
	updateAttachedPositioning();
	updateNodeLevels();
}
示例#17
0
void FadClearLineEdit::init()
{
    tButtonClearText.setCursor( Qt::ArrowCursor );
    tButtonClearText.setFocusPolicy( Qt::NoFocus );
    tButtonClearText.setStyleSheet( "QToolButton { border: none; }" );
    tButtonClearText.setToolButtonStyle( Qt::ToolButtonIconOnly );
    tButtonClearText.setIcon( QIcon( ":/text-clear" ) );
    tButtonClearText.setIconSize( QSize( 14, 14 ) );
    tButtonClearText.setToolTip( tr( "Clear text" ) );
    tButtonClearText.setStatusTip( tr( "Clear text" ) );
    tButtonClearText.setWhatsThis( tr( "Clear text" ) );
    addButton( &tButtonClearText );

    connect( &tButtonClearText, SIGNAL( clicked() ), SLOT( clear() ) );
    connect( &tButtonClearText, SIGNAL( clicked() ), SIGNAL( cleansingText() ) );
    connect( &tButtonClearText, SIGNAL( clicked() ), SLOT( updateStates() ) );

    connect( this, SIGNAL( textEdited(QString) ), SLOT( updateStates() ) );
}
示例#18
0
Load::Load() : Menu(NULL, NULL)
{
	//addButton(new UIButton("MenuOptionsLoad"));
	

	addButton(new UIButton("Slot1"));	
	addButton(new UIButton("Slot2"));
	addButton(new UIButton("Slot3"));
	addButton(new UIButton("Slot4"));
	addButton(new UIButton("Slot5"));
	addButton(new UIButton("Back"));

	m_Level = new Level(false);
}
示例#19
0
void SessionsBox::prepare() {
	setTitle(langFactory(lng_sessions_other_header));

	addButton(langFactory(lng_close), [this] { closeBox(); });

	setDimensions(st::boxWideWidth, st::sessionsHeight);

	connect(_inner, SIGNAL(oneTerminated()), this, SLOT(onOneTerminated()));
	connect(_inner, SIGNAL(allTerminated()), this, SLOT(onAllTerminated()));
	connect(_inner, SIGNAL(terminateAll()), this, SLOT(onTerminateAll()));
	connect(App::wnd(), SIGNAL(checkNewAuthorization()), this, SLOT(onCheckNewAuthorization()));
	connect(_shortPollTimer, SIGNAL(timeout()), this, SLOT(onShortPollAuthorizations()));

	_inner = setInnerWidget(object_ptr<Inner>(this, &_list, &_current), st::sessionsScroll);
	_inner->resize(width(), st::noContactsHeight);

	setLoading(true);

	MTP::send(MTPaccount_GetAuthorizations(), rpcDone(&SessionsBox::gotAuthorizations));
}
示例#20
0
bool SlideNavmesh::init()
{
	if (!navsceneLoad(&m_scene, m_filepath))
	{
		return false;
	}
	
	m_dim[0] = m_scene.dim[0] + PADDING_SIZE*2;
	m_dim[1] = m_scene.dim[1] + PADDING_SIZE*2;
	
	const float bw = BUTTON_WIDTH*0.7f;
	float x = PADDING_SIZE;
	float y = PADDING_SIZE/4;
	addButton(3,"Graph",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;
	addButton(2,"Corridor",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;
	addButton(1,"Corner",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;
	addButton(9,"Delta",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;
	addButton(8,"Visited",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;
	
	x += 0.3f;
	
	addButton(5,"Straight",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;
	addButton(6,"Smooth",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;
	addButton(7,"Drunk",x,y,bw,BUTTON_HEIGHT);
	x += bw+0.1f;

	m_expanded = true;
	m_step = false;
	m_update = false;
	
	return true;
}
示例#21
0
CircMenu::CircMenu(int numButtons, int size)
:CircButton(size)
{
	amp			= 250.f;
	bounce		= 3.f;
	
	rangeBegin	= 0;
	rangeEnd	= 360;
	
	openDuration	= .45f;
	openDelay		= .1f;
	closeDuration	= .35f;
	closeDelay		= .1f;
	
	isOpen		= false;
	
	for(int i=0; i<numButtons; i++){
		addButton();
	}
}
MountOperationQuestionDialog::MountOperationQuestionDialog(MountOperation* op, gchar* message, GStrv choices):
  QMessageBox(),
  mountOperation(op) {

  setIcon(QMessageBox::Question);
  setText(QString::fromUtf8(message));

  choiceCount = g_strv_length(choices);
  choiceButtons = new QAbstractButton*[choiceCount];
  for(int i = 0; i < choiceCount; ++i) {
    // It's not allowed to add custom buttons without standard roles
    // to QMessageBox. So we set role of all buttons to AcceptRole and
    // handle their clicked() signals in our own slots.
    // When anyone of the buttons is clicked, exec() always returns "accept".
    QPushButton* button = new QPushButton(QString::fromUtf8(choices[i]));
    addButton(button, QMessageBox::AcceptRole);
    choiceButtons[i] = button;
  }
  connect(this, &MountOperationQuestionDialog::buttonClicked, this, &MountOperationQuestionDialog::onButtonClicked);
}
示例#23
0
void FileBrowser::update() {
	if(_page == _renderedPage) return;
	_renderedPage = _page;
	while(_buttons != NULL) {
		UIButton * next = _buttons->next;
		delete _buttons;
		_buttons = next;
	}

	if(_menu != NULL) delete _menu;

	byte count = 0,
		x;

	file * f = _dir->getFiles();
	while(f != NULL && count < (_page + 1) * _numFilenames) { //this is really lame, but i'm kinda tired ;P
	    count++;
	    f = f->next;
	}

	f = _dir->getFiles();
	for(byte x=0; x<_page * (_numFilenames - 1); x++) {
		f = f->next;
		count--;
	}
	count > _numFilenames && (count = _numFilenames);
	for(byte x=0; x<count; x++) {
		_filenames[x] = x == 5 && f->next != NULL ? "More -->>" : f->name;
		f = f->next;
	}

	_menu = new Menu(_title, count, _filenames);	

	_menu->render(_tft);

	UIButton * b = _menu->getButtons();
	while(b != NULL) {
		addButton(b->x, b->y, b->width, b->height);
		b = b->next;
	}
}
示例#24
0
SuperLamp::SuperLamp(DoorButton* _db){
    ifChoosed=0;
    choosedFlag = 0;
    db=_db;
    size = Vector3(0.15,0.15,0.15);
//    Cylinder * cover = new Cylinder(1,2,3,false,false);
//    cover->location.x=0;
//    cover->location.y=0;
//    cover->location.z=0;
//    addChild(cover);
//    
    Bulb * bulb = new Bulb(Vector3(1,0,1));
    bulb->location = Vector3(17,5,-12);
    bulb->angle=70;
    bulb->direction = Vector3(0,-1,0);
    bulb->size = Vector3(2,2,2);
    addChild(bulb);
    mybulb=bulb;
//
//    Cylinder * pillar = new Cylinder(0.2,0.2,5,true,true);
//    pillar->location.x=0;
//    pillar->location.y=-1;
//    pillar->location.z=0;
//    addChild(pillar);
//    
//    Cylinder * bottom = new Cylinder(2,2,0.5,true,true);
//    bottom->location.x=0;
//    bottom->location.y=-6;
//    bottom->location.z=0;
//    addChild(bottom);
//    
    Button *xbutton = new Button();
    addButton(xbutton);
//    button->location.x=1.0;
////    button->location.y=-5.8;
//    button->location.y=5;
//    button->location.z=0;
    xbutton->bulb=bulb;
//    addChild(button);
    
}
示例#25
0
StutterSection::StutterSection(String name) : SynthSection(name) {
  static const int TEMPO_DRAG_SENSITIVITY = 150;

  addSlider(stutter_frequency_ = new SynthSlider("stutter_frequency"));
  stutter_frequency_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  stutter_frequency_->setLookAndFeel(TextLookAndFeel::instance());

  addSlider(stutter_tempo_ = new SynthSlider("stutter_tempo"));
  stutter_tempo_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  stutter_tempo_->setStringLookup(mopo::strings::synced_frequencies);
  stutter_tempo_->setLookAndFeel(TextLookAndFeel::instance());
  stutter_tempo_->setMouseDragSensitivity(TEMPO_DRAG_SENSITIVITY);

  addSlider(stutter_sync_ = new TempoSelector("stutter_sync"));
  stutter_sync_->setSliderStyle(Slider::LinearBar);
  stutter_sync_->setTempoSlider(stutter_tempo_);
  stutter_sync_->setFreeSlider(stutter_frequency_);
  stutter_sync_->setStringLookup(mopo::strings::freq_sync_styles);

  addSlider(resample_frequency_ = new SynthSlider("stutter_resample_frequency"));
  resample_frequency_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  resample_frequency_->setLookAndFeel(TextLookAndFeel::instance());

  addSlider(resample_tempo_ = new SynthSlider("stutter_resample_tempo"));
  resample_tempo_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  resample_tempo_->setStringLookup(mopo::strings::synced_frequencies);
  resample_tempo_->setLookAndFeel(TextLookAndFeel::instance());
  resample_tempo_->setMouseDragSensitivity(TEMPO_DRAG_SENSITIVITY);

  addSlider(resample_sync_ = new TempoSelector("stutter_resample_sync"));
  resample_sync_->setSliderStyle(Slider::LinearBar);
  resample_sync_->setTempoSlider(resample_tempo_);
  resample_sync_->setFreeSlider(resample_frequency_);
  resample_sync_->setStringLookup(mopo::strings::freq_sync_styles);

  addSlider(stutter_softness_ = new SynthSlider("stutter_softness"));
  stutter_softness_->setSliderStyle(Slider::LinearBar);

  addButton(on_ = new ToggleButton("stutter_on"));
  setActivator(on_);
}
示例#26
0
void Sidebar_Widget::createButtons()
{
	if (!m_path.isEmpty())
	{
		kdDebug()<<"m_path: "<<m_path<<endl;
		QDir dir(m_path);
		QStringList list=dir.entryList("*.desktop");
		for (QStringList::Iterator it=list.begin(); it!=list.end(); ++it)
		{
			addButton(*it);
		}
	}

	if (!m_buttonBar->button(-1)) {
		m_buttonBar->appendButton(SmallIcon("configure"), -1, m_menu,
					i18n("Configure Sidebar"));
	}

	if (m_showExtraButtons && !m_disableConfig) {
		m_buttonBar->button(-1)->show();
	} else {
		m_buttonBar->button(-1)->hide();
	}

	for (uint i = 0; i < m_buttons.count(); i++)
	{
		ButtonInfo *button = m_buttons.at(i);
		if (m_openViews.contains(button->file))
		{
			m_buttonBar->setTab(i,true);
			m_noUpdate = true;
			showHidePage(i);
			if (m_singleWidgetMode) {
				break;
			}
		}
	}

	collapseExpandSidebar();
        m_noUpdate=false;
}
void CalendarBox::prepare() {
	_previous->setClickedCallback([this] {
		if (isPreviousEnabled()) {
			_context->skipMonth(-1);
		}
	});
	_next->setClickedCallback([this] {
		if (isNextEnabled()) {
			_context->skipMonth(1);
		}
	});

//	_inner = setInnerWidget(object_ptr<Inner>(this, _context.get()), st::calendarScroll, st::calendarTitleHeight);
	_inner->setDateChosenCallback(std::move(_callback));

	addButton(langFactory(lng_close), [this] { closeBox(); });

	subscribe(_context->month(), [this](QDate month) { monthChanged(month); });

	_context->start();
}
示例#28
0
void QgsOgrSourceSelect::on_buttonSelectSrc_clicked()
{
  if ( radioSrcFile->isChecked() )
  {
    QStringList selected = openFile();
    if ( !selected.isEmpty() )
    {
      inputSrcDataset->setText( selected.join( QStringLiteral( ";" ) ) );
      addButton()->setFocus();
      emit enableButtons( true );
    }
  }
  else if ( radioSrcDirectory->isChecked() )
  {
    inputSrcDataset->setText( openDirectory() );
  }
  else if ( !radioSrcDatabase->isChecked() )
  {
    Q_ASSERT( !"SHOULD NEVER GET HERE" );
  }
}
void AboutBox::prepare() {
	setTitle([] { return qsl("Telegram Desktop"); });

	addButton(langFactory(lng_close), [this] { closeBox(); });

	const auto linkFilter = [](const ClickHandlerPtr &link, auto button) {
		if (const auto url = dynamic_cast<UrlClickHandler*>(link.get())) {
			url->UrlClickHandler::onClick({ button });
			return false;
		}
		return true;
	};

	_text3->setRichText(lng_about_text_3(lt_faq_open, qsl("[a href=\"%1\"]").arg(telegramFaqLink()), lt_faq_close, qsl("[/a]")));
	_text1->setClickHandlerFilter(linkFilter);
	_text2->setClickHandlerFilter(linkFilter);
	_text3->setClickHandlerFilter(linkFilter);

	_version->setClickedCallback([this] { showVersionHistory(); });

	setDimensions(st::aboutWidth, st::aboutTextTop + _text1->height() + st::aboutSkip + _text2->height() + st::aboutSkip + _text3->height());
}
示例#30
0
PathChooser::PathChooser(QWidget *parent) :
    QWidget(parent),
    m_d(new PathChooserPrivate(this))
{
    m_d->m_hLayout->setContentsMargins(0, 0, 0, 0);

    connect(m_d->m_lineEdit, SIGNAL(validReturnPressed()), this, SIGNAL(returnPressed()));
    connect(m_d->m_lineEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed(QString)));
    connect(m_d->m_lineEdit, SIGNAL(validChanged()), this, SIGNAL(validChanged()));
    connect(m_d->m_lineEdit, SIGNAL(validChanged(bool)), this, SIGNAL(validChanged(bool)));
    connect(m_d->m_lineEdit, SIGNAL(editingFinished()), this, SIGNAL(editingFinished()));

    m_d->m_lineEdit->setMinimumWidth(200);
    m_d->m_hLayout->addWidget(m_d->m_lineEdit);
    m_d->m_hLayout->setSizeConstraint(QLayout::SetMinimumSize);

    addButton(tr(browseButtonLabel), this, SLOT(slotBrowse()));

    setLayout(m_d->m_hLayout);
    setFocusProxy(m_d->m_lineEdit);
    setEnvironment(Environment::systemEnvironment());
}