Hallo,
Wie kann man in einem Fenster einen eSlider oder eine eComboBox als Default Einstellung Setzen ?
Hallo,
Wie kann man in einem Fenster einen eSlider oder eine eComboBox als Default Einstellung Setzen ?
Hi viahack,
meinst Du wenn der Dialog aufgebaut wird? Wenn ja, am Ende des Konstruktors setFocus(NameDesElements).; .
Grüße
tYREL
Hier mal ein Beispiel:
eDemoDialog::eDemoDialog(): eWindow(1)
{
// move our dialog to 100.100...
cmove(ePoint(100, 100));
// ...and make it fill the screen.
cresize(eSize(520, 376));
// set a title.
setText("enigma demo plugin demonstration");
// create our listbox. it's a child of our window, thus we give "this" as parent.
listbox=new eListBox<eListBoxEntryText>(this);
// move it into our widget. all positions are relative to the parent widget.
listbox->move(ePoint(10, 10));
// leave some space for the buttons (thus height()-100)
listbox->resize(eSize(clientrect.width()-20, clientrect.height()-60));
listbox->loadDeco();
// create the ok button
bt_ok=new eButton(this);
bt_ok->move(ePoint(clientrect.width()-110, clientrect.height()-40));
bt_ok->resize(eSize(100, 30));
// set the shortcut action. in this case, it's the green button.
bt_ok->setShortcut("green");
bt_ok->setShortcutPixmap("green");
// load some decoration (border)
bt_ok->loadDeco();
// set Text
bt_ok->setText("OK");
// "connect" the button. if the user pressed this button (either by selecting it and pressing
// OK or by pressing green) the button should to something:
// in this case, this will connect bt_ok->selected to our "accept dialog".
// accept is just a close(0); - we will return with zero as return code.
CONNECT(bt_ok->selected, eWidget::accept);
lb_selected=new eLabel(this);
lb_selected->move(ePoint(120, clientrect.height()-40));
lb_selected->resize(eSize(clientrect.width()-120-120, 30)); // leave space for both buttons
lb_selected->setText("move selection!");
// create the abort button
bt_abort=new eButton(this);
bt_abort->move(ePoint(10, clientrect.height()-40)); // listbox goes to height()-40
bt_abort->resize(eSize(100, 30));
bt_abort->setShortcut("red");
bt_abort->setShortcutPixmap("red");
bt_abort->loadDeco();
bt_abort->setText("Abort");
// reject is close(1) - we will return with nonzero return code.
CONNECT(bt_abort->selected, eWidget::reject);
// create some dummy listbox entries:
new eListBoxEntryText(listbox, "This is a listbox.", (void*)0);
new eListBoxEntryText(listbox, "and has multiple entries", (void*)1);
new eListBoxEntryText(listbox, "which have all", (void*)2);
new eListBoxEntryText(listbox, "some specific meaning.", (void*)3);
// if the user selects an item, we want to be notified:
CONNECT(listbox->selected, eDemoDialog::selectedItem);
// if the user selects an item, we want to be notified:
CONNECT(listbox->selchanged, eDemoDialog::selectionChanged);
// and we set the focus to the listbox:
setFocus(listbox);
counter=0;
}
Alles anzeigen
zur Zeit sind 12 Mitglieder (davon 1 unsichtbar) und 1.820 Gäste online - Rekord: 5.681 Benutzer ()