Patch level : 10.0
Files correlati : tutti Ricompilazione Demo : [ ] Commento : 0000874: Toolbar Verificare se e' possibilie ripristinare gli acceleratori sulle toolbar 0000894: Nel tooltip dei pulsanti della barra degli strumenti visualizzare la combinazione dell'acceleratore. Esempio: CTRL + N (come office) 0000900: Menu Dopo aver selezionato un menù, dalla barra dei menù, non è più possibile vedere il menù intero. git-svn-id: svn://10.65.10.50/trunk@17291 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ff67e9019f
commit
f1e5760906
@ -10,7 +10,6 @@ static bool is_outlook_menu_chain()
|
||||
const TFixed_string app(__argv[0]);
|
||||
if (app.match("*ba[0,1]*", true))
|
||||
return false;
|
||||
|
||||
TConfig ini(CONFIG_GUI, "Colors");
|
||||
return ini.get_int("TreeView") == 3;
|
||||
}
|
||||
|
@ -718,7 +718,7 @@ bool TMask::stop_run(
|
||||
for (i = 0; i < last; i++)
|
||||
{
|
||||
const TMask_field& f = fld(i);
|
||||
if (f.active())
|
||||
if (f.is_operable() && !f.is_editable() && f.active())
|
||||
{
|
||||
if (f.is_kind_of(CLASS_BUTTON_FIELD))
|
||||
{
|
||||
@ -968,7 +968,7 @@ bool TMask::on_key(
|
||||
TMask_field& f = fld(fire);
|
||||
if (f.parent() != myparent)
|
||||
break;
|
||||
if (f.is_kind_of(CLASS_SHEET_FIELD))
|
||||
if (f.is_sheet())
|
||||
{
|
||||
TSheet_field& s = (TSheet_field&)f;
|
||||
const int newrow = s.append() ? -1 : ( _focus == fire ? s.selected() + 1: 0);
|
||||
@ -994,10 +994,20 @@ bool TMask::on_key(
|
||||
for (int i = fields()-1; i >= 0; i--)
|
||||
{
|
||||
TMask_field& f = fld(i);
|
||||
if (f.active() && f.is_kind_of(CLASS_BUTTON_FIELD))
|
||||
if (f.is_operable() && !f.is_editable() && f.active())
|
||||
{
|
||||
TButton_field& b = (TButton_field&)f;
|
||||
if (b.virtual_key() == key)
|
||||
KEY vk = 0;
|
||||
if (f.is_kind_of(CLASS_BUTTON_FIELD))
|
||||
{
|
||||
TButton_field& b = (TButton_field&)f;
|
||||
vk = b.virtual_key();
|
||||
} else
|
||||
if (f.is_kind_of(CLASS_BUTTON_TOOL))
|
||||
{
|
||||
TButton_tool& t = (TButton_tool&)f;
|
||||
vk = t.virtual_key();
|
||||
}
|
||||
if (vk > 0 && vk == key)
|
||||
{
|
||||
f.on_key(K_SPACE);
|
||||
break;
|
||||
|
@ -901,12 +901,12 @@ bool TOperable_field::do_message(int num)
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd == 9)
|
||||
if (cmd == 9) // EXIT
|
||||
{
|
||||
mask().stop_run(atoi(dlg));
|
||||
continue;
|
||||
} else
|
||||
if (cmd == 15)
|
||||
if (cmd == 15) // RUN
|
||||
{
|
||||
run_app(mask(), msg);
|
||||
continue;
|
||||
@ -1088,8 +1088,7 @@ bool TButton_field::parse_item(TScanner& scanner)
|
||||
|
||||
void TButton_field::create(WINDOW parent)
|
||||
{
|
||||
_exit_key = 0;
|
||||
_virtual_key = 0;
|
||||
_virtual_key = _exit_key = 0;
|
||||
switch (dlg())
|
||||
{
|
||||
case DLG_OK:
|
||||
@ -1169,7 +1168,7 @@ void TButton_field::create(WINDOW parent)
|
||||
|
||||
if (_virtual_key == 0)
|
||||
{
|
||||
char acc = ((TPushbutton_control*)_ctl)->mnemonic();
|
||||
const char acc = ((TPushbutton_control*)_ctl)->mnemonic();
|
||||
_virtual_key = (acc > ' ') ? toupper(acc) : _exit_key;
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +1,20 @@
|
||||
BUTTON DLG_NEWREC 2 2
|
||||
BEGIN
|
||||
PROMPT 1 1 "Nuovo"
|
||||
PROMPT 1 1 "~Nuovo"
|
||||
MESSAGE EXIT,K_INS
|
||||
PICTURE BMP_NEWREC
|
||||
END
|
||||
|
||||
BUTTON DLG_SAVEREC 2 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Registra"
|
||||
PROMPT 2 1 "~Registra"
|
||||
MESSAGE EXIT,K_SAVE
|
||||
PICTURE BMP_SAVEREC
|
||||
END
|
||||
|
||||
BUTTON DLG_DELREC 2 2
|
||||
BEGIN
|
||||
PROMPT 3 1 "Elimina"
|
||||
PROMPT 3 1 "~Elimina"
|
||||
MESSAGE EXIT,K_DEL
|
||||
PICTURE BMP_DELREC
|
||||
END
|
||||
@ -35,7 +35,7 @@ END
|
||||
|
||||
BUTTON DLG_FINDREC 2 2
|
||||
BEGIN
|
||||
PROMPT 6 1 "Ricerca"
|
||||
PROMPT 6 1 "Ri~cerca"
|
||||
MESSAGE EXIT,K_F9
|
||||
PICTURE 166
|
||||
END
|
||||
|
@ -79,7 +79,7 @@ void TButton_tool::set_exit_key(KEY k)
|
||||
void TButton_tool::create(WINDOW toolbar)
|
||||
{
|
||||
TTool_field::create(toolbar);
|
||||
_exit_key = 0;
|
||||
_virtual_key = _exit_key = 0;
|
||||
switch (dlg())
|
||||
{
|
||||
case DLG_OK:
|
||||
@ -92,20 +92,21 @@ void TButton_tool::create(WINDOW toolbar)
|
||||
case DLG_CANCEL:
|
||||
if (_ctl_data._prompt.empty())
|
||||
_ctl_data._prompt = TR("Annulla");
|
||||
_virtual_key = K_ESC;
|
||||
set_exit_key(K_ESC);
|
||||
if (_ctl_data._bmp_up <= 0)
|
||||
_ctl_data._bmp_up = BMP_CANCEL;
|
||||
break;
|
||||
case DLG_DELREC:
|
||||
if (_ctl_data._prompt.empty())
|
||||
_ctl_data._prompt = TR("Elimina");
|
||||
_ctl_data._prompt = TR("~Elimina");
|
||||
set_exit_key(K_DEL);
|
||||
if (_ctl_data._bmp_up <= 0)
|
||||
_ctl_data._bmp_up = BMP_DELREC;
|
||||
break;
|
||||
case DLG_PRINT:
|
||||
if (_ctl_data._prompt.empty())
|
||||
_ctl_data._prompt = TR("Stampa");
|
||||
_ctl_data._prompt = TR("~Stampa");
|
||||
set_exit_key(K_ENTER);
|
||||
if (_ctl_data._bmp_up <= 0)
|
||||
_ctl_data._bmp_up = BMP_PRINT;
|
||||
@ -120,6 +121,7 @@ void TButton_tool::create(WINDOW toolbar)
|
||||
case DLG_QUIT:
|
||||
if (_ctl_data._prompt.empty())
|
||||
_ctl_data._prompt = TR("Fine");
|
||||
_virtual_key = K_F4; // Alt+F4
|
||||
set_exit_key(K_QUIT);
|
||||
if (_ctl_data._bmp_up <= 0)
|
||||
_ctl_data._bmp_up = BMP_QUIT;
|
||||
@ -146,8 +148,13 @@ void TButton_tool::create(WINDOW toolbar)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_ctl_data._prompt.strip("~&"); // Togli eventuali acceleratori antiestetici
|
||||
|
||||
if (_virtual_key <= 0)
|
||||
{
|
||||
const char acc = _ctl_data._prompt.after("~")[0];
|
||||
if (acc >= 'A'&& acc <= 'z')
|
||||
_virtual_key = toupper(acc);
|
||||
}
|
||||
|
||||
if (dlg() <= 0 || _ctl_data._bmp_up <= 0)
|
||||
xvt_toolbar_add_control(toolbar, -1, TOOL_SEPARATOR, "", 0, _ctl_data._width, -1);
|
||||
@ -156,7 +163,7 @@ void TButton_tool::create(WINDOW toolbar)
|
||||
_ctl_data._bmp_up, _ctl_data._width, -1);
|
||||
|
||||
TToken_string* mess = message(0);
|
||||
if (mess)
|
||||
if (mess != NULL)
|
||||
{
|
||||
TToken_string msg(mess->get(0), ',');
|
||||
const TFixed_string m = msg.get(0);
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
|
||||
class TButton_tool : public TTool_field
|
||||
{
|
||||
KEY _exit_key;
|
||||
KEY _virtual_key, _exit_key;
|
||||
|
||||
protected:
|
||||
virtual void parse_head(TScanner& scanner);
|
||||
@ -37,6 +37,7 @@ public:
|
||||
virtual word class_id() const;
|
||||
virtual bool is_kind_of(word cid) const;
|
||||
void set_exit_key(KEY k);
|
||||
KEY virtual_key() const { return _virtual_key; }
|
||||
KEY exit_key() const { return _exit_key; }
|
||||
TButton_tool(TMask* mask);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user