applicat.* Aggiunta l'utilissima TSkeleton_app per creare semplici applicazioni
bafgn006.uml Migliorata maschera di gestione Golem default.url La voce 'Editor' del menu e' diventata 'Editors' per i Golem golem.cpp Migliorata maschera di gestione Golem maskfld.* Aggiunto il metodo TButton_field::set_icon xvtility.cpp Corretta gestione del tasto F1 git-svn-id: svn://10.65.10.50/trunk@5354 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
e013f6b878
commit
b7b5f606a8
@ -772,12 +772,25 @@ bool TApplication::firm_change_enabled() const
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void TApplication::on_firm_change()
|
void TApplication::on_firm_change()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void TApplication::on_config_change()
|
void TApplication::on_config_change()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// The Skeleton application!
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool TSkeleton_application::create()
|
||||||
|
{
|
||||||
|
dispatch_e_menu(BAR_ITEM(1));
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TSkeleton_application::menu(MENU_TAG)
|
||||||
|
{
|
||||||
|
main_loop();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -192,6 +192,21 @@ public:
|
|||||||
virtual ~TApplication();
|
virtual ~TApplication();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class TSkeleton_application : public TApplication
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
virtual bool create();
|
||||||
|
virtual bool menu(MENU_TAG);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void main_loop() pure;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TSkeleton_application() { }
|
||||||
|
virtual ~TSkeleton_application() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
bool xvt_running();
|
bool xvt_running();
|
||||||
TApplication& main_app();
|
TApplication& main_app();
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ PAGE "Oggetti esterni" -1, -1, 76, 16
|
|||||||
|
|
||||||
SPREADSHEET F_SHEET 0 -3
|
SPREADSHEET F_SHEET 0 -3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 1 "Lista"
|
PROMPT 1 4 "Lista"
|
||||||
ITEM "File@35"
|
ITEM "File@35"
|
||||||
ITEM "Nome@15"
|
ITEM "Nome@15"
|
||||||
ITEM "Collegamento"
|
ITEM "Collegamento"
|
||||||
@ -23,8 +23,8 @@ END
|
|||||||
|
|
||||||
BUTTON F_LINK 10 2
|
BUTTON F_LINK 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -35 -1 ""
|
PROMPT -35 -1 "~Edit"
|
||||||
PICTURE BMP_LINK
|
PICTURE BMP_EDIT
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_PRINT 10 2
|
BUTTON F_PRINT 10 2
|
||||||
@ -74,8 +74,8 @@ END
|
|||||||
|
|
||||||
BUTTON F_LINK 10 2
|
BUTTON F_LINK 10 2
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT -35 -1 ""
|
PROMPT -35 -1 "~Edit"
|
||||||
PICTURE BMP_LINK
|
PICTURE BMP_EDIT
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON F_PRINT 10 2
|
BUTTON F_PRINT 10 2
|
||||||
|
@ -100,10 +100,10 @@ image BMP_DELREC QRESDIR"delrec.bmp"
|
|||||||
image BMP_DELRECDN QRESDIR"delrecdn.bmp"
|
image BMP_DELRECDN QRESDIR"delrecdn.bmp"
|
||||||
image BMP_FINDREC QRESDIR"findrec.bmp"
|
image BMP_FINDREC QRESDIR"findrec.bmp"
|
||||||
image BMP_SEARCH QRESDIR"search.bmp"
|
image BMP_SEARCH QRESDIR"search.bmp"
|
||||||
image BMP_CHECK_ON QRESDIR"checkon.bmp"
|
//image BMP_CHECK_ON QRESDIR"checkon.bmp"
|
||||||
image BMP_CHECK_OFF QRESDIR"checkoff.bmp"
|
//image BMP_CHECK_OFF QRESDIR"checkoff.bmp"
|
||||||
image BMP_RADIO_ON QRESDIR"radioon.bmp"
|
//image BMP_RADIO_ON QRESDIR"radioon.bmp"
|
||||||
image BMP_RADIO_OFF QRESDIR"radiooff.bmp"
|
//image BMP_RADIO_OFF QRESDIR"radiooff.bmp"
|
||||||
image BMP_MODULE1 QRESDIR"module1.bmp"
|
image BMP_MODULE1 QRESDIR"module1.bmp"
|
||||||
image BMP_MODULE2 QRESDIR"module2.bmp"
|
image BMP_MODULE2 QRESDIR"module2.bmp"
|
||||||
image BMP_MODULE3 QRESDIR"module3.bmp"
|
image BMP_MODULE3 QRESDIR"module3.bmp"
|
||||||
|
@ -68,9 +68,6 @@ HIDDEN bool file2app(const char* filename, TString& app)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok && !fexist(app))
|
|
||||||
ok = warning_box("Il programma %s e' stato rimosso!", app.get_buffer());
|
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,6 +178,208 @@ HIDDEN bool print_url(const char* url)
|
|||||||
return error >= 32;
|
return error >= 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
// Maschera GOLEM
|
||||||
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
class TGolem_mask : public TMask
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
static bool file_handler(TMask_field& f, KEY k);
|
||||||
|
static bool link_handler(TMask_field& f, KEY k);
|
||||||
|
static bool main_link_handler(TMask_field& f, KEY k);
|
||||||
|
static bool ole_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
|
public:
|
||||||
|
TGolem_mask();
|
||||||
|
virtual ~TGolem_mask() { }
|
||||||
|
};
|
||||||
|
|
||||||
|
bool TGolem_mask::file_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
|
|
||||||
|
if (k == K_F9)
|
||||||
|
{
|
||||||
|
FILE_SPEC fs;
|
||||||
|
xvt_fsys_convert_str_to_dir(".", &fs.dir);
|
||||||
|
strcpy(fs.type, "");
|
||||||
|
strcpy(fs.name, "*.*");
|
||||||
|
strcpy(fs.creator, "GOLEM");
|
||||||
|
|
||||||
|
xvt_fsys_save_dir();
|
||||||
|
FL_STATUS ok = xvt_dm_post_file_open(&fs, "Selezionare il file ...");
|
||||||
|
if (ok == FL_OK)
|
||||||
|
{
|
||||||
|
xvt_fsys_restore_dir();
|
||||||
|
|
||||||
|
TFilename file;
|
||||||
|
xvt_fsys_convert_dir_to_str(&fs.dir, file.get_buffer(), file.size());
|
||||||
|
file.add(fs.name);
|
||||||
|
file.ext(fs.type);
|
||||||
|
f.set(file);
|
||||||
|
k = K_TAB;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (k == K_TAB && f.focusdirty())
|
||||||
|
{
|
||||||
|
TFilename file = m.get(S_FILE);
|
||||||
|
if (fexist(file))
|
||||||
|
{
|
||||||
|
char ext[_MAX_EXT];
|
||||||
|
char name[_MAX_FNAME];
|
||||||
|
_splitpath(file, NULL, NULL, name, ext);
|
||||||
|
file = name; file.ext(ext);
|
||||||
|
m.enable(S_LINK);
|
||||||
|
m.disable(F_NEWREC);
|
||||||
|
m.enable(F_LINK);
|
||||||
|
m.enable(F_PRINT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const bool full = file.not_empty();
|
||||||
|
m.set(S_LINK, full ? "X" : "");
|
||||||
|
m.disable(S_LINK);
|
||||||
|
m.enable(F_NEWREC, full);
|
||||||
|
m.enable(F_LINK, full);
|
||||||
|
m.disable(F_PRINT);
|
||||||
|
file.cut(0);
|
||||||
|
}
|
||||||
|
m.set(S_ALIAS, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TGolem_mask::link_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TMask& m = f.mask();
|
||||||
|
TFilename url = m.get(S_FILE);
|
||||||
|
short id = f.dlg();
|
||||||
|
if (id == F_NEWREC && url.not_empty())
|
||||||
|
{
|
||||||
|
if (!fexist(url))
|
||||||
|
{
|
||||||
|
TFilename name;
|
||||||
|
char ext[_MAX_EXT];
|
||||||
|
_splitpath(url, NULL, NULL, name.get_buffer(), ext);
|
||||||
|
if (name.not_empty() && *ext)
|
||||||
|
{
|
||||||
|
name.ext(ext);
|
||||||
|
url.tempdir();
|
||||||
|
url.add(name);
|
||||||
|
ofstream out(url); // Crea un file vuoto
|
||||||
|
}
|
||||||
|
else
|
||||||
|
url.cut(0);
|
||||||
|
m.set(S_FILE, url, TRUE); // ... memorizza il suo nome ...
|
||||||
|
m.reset(S_LINK); // Non puo' essere un collegamento
|
||||||
|
}
|
||||||
|
else
|
||||||
|
id = F_LINK;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.not_empty())
|
||||||
|
{
|
||||||
|
bool open = TRUE;
|
||||||
|
if (id == DLG_PRINT)
|
||||||
|
open = !print_url(url);
|
||||||
|
if (open)
|
||||||
|
goto_url(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TGolem_mask::main_link_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TSheet_field& sheet = f.mask().sfield(F_SHEET);
|
||||||
|
if (sheet.items() > 0)
|
||||||
|
{
|
||||||
|
sheet.check_row(sheet.selected());
|
||||||
|
TMask& sm = sheet.sheet_mask();
|
||||||
|
TMask_field& link = sm.field(f.dlg());
|
||||||
|
link_handler(link, K_SPACE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TGolem_mask::ole_handler(TMask_field& f, KEY k)
|
||||||
|
{
|
||||||
|
if (k == K_SPACE)
|
||||||
|
{
|
||||||
|
TSheet_field& sheet = f.mask().sfield(F_SHEET);
|
||||||
|
if (sheet.items() == 0)
|
||||||
|
sheet.row(-1);
|
||||||
|
|
||||||
|
sheet.check_row(sheet.selected());
|
||||||
|
TMask& sm = sheet.sheet_mask();
|
||||||
|
TString16 ext = f.prompt();
|
||||||
|
if (ext[0] != '.')
|
||||||
|
ext.insert(".", 0);
|
||||||
|
|
||||||
|
TFilename file = sm.get(S_FILE);
|
||||||
|
if (file.blank())
|
||||||
|
{
|
||||||
|
file.temp(NULL, ext);
|
||||||
|
sm.set(S_FILE, file);
|
||||||
|
ofstream out(file);
|
||||||
|
sheet.row(sheet.selected()) = file;
|
||||||
|
}
|
||||||
|
sheet.force_update();
|
||||||
|
|
||||||
|
TFilename app; file2app(ext, app);
|
||||||
|
app << ' ' << file;
|
||||||
|
WinExec(app, SW_SHOWNORMAL);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
TGolem_mask::TGolem_mask()
|
||||||
|
: TMask("bagn006")
|
||||||
|
{
|
||||||
|
TSheet_field& sheet = sfield(F_SHEET);
|
||||||
|
|
||||||
|
set_handler(F_NEWREC, main_link_handler);
|
||||||
|
set_handler(F_LINK, main_link_handler);
|
||||||
|
set_handler(F_PRINT, main_link_handler);
|
||||||
|
|
||||||
|
TMask& sm = sheet.sheet_mask();
|
||||||
|
sm.set_handler(S_FILE, file_handler);
|
||||||
|
sm.set_handler(F_NEWREC, link_handler);
|
||||||
|
sm.set_handler(F_LINK, link_handler);
|
||||||
|
sm.set_handler(F_PRINT, link_handler);
|
||||||
|
|
||||||
|
TConfig ini(CONFIG_USER, "Link");
|
||||||
|
TString_array list;
|
||||||
|
const int items = ini.list_variables(list);
|
||||||
|
list.sort();
|
||||||
|
const int ITEMS_PER_ROW = 15;
|
||||||
|
const int MAX_ITEMS = ITEMS_PER_ROW * 2 - 1;
|
||||||
|
for (int i = 0; i < items && i < MAX_ITEMS; i++)
|
||||||
|
{
|
||||||
|
TString16 ext = list.row(i);
|
||||||
|
const int x = (i < ITEMS_PER_ROW ? i*5 : (i-ITEMS_PER_ROW)*5) + 1;
|
||||||
|
const int y = i < ITEMS_PER_ROW ? 0 : 2;
|
||||||
|
TButton_field& btn = add_button(301+i, 0, ext, x, y, 3, 2);
|
||||||
|
btn.set_handler(ole_handler);
|
||||||
|
|
||||||
|
if (ext[0] != '.')
|
||||||
|
ext.insert(".", 0);
|
||||||
|
word icon = file2icon(ext);
|
||||||
|
if (icon)
|
||||||
|
btn.set_icon(icon);
|
||||||
|
else
|
||||||
|
btn.set_bmp(BMP_OLE, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Campi GOLEM
|
// Campi GOLEM
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -301,137 +500,15 @@ bool TGolem_field::autosave(TRelation& r)
|
|||||||
return TEditable_field::autosave(r);
|
return TEditable_field::autosave(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool file_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
TMask& m = f.mask();
|
|
||||||
|
|
||||||
if (k == K_F9)
|
|
||||||
{
|
|
||||||
FILE_SPEC fs;
|
|
||||||
xvt_fsys_convert_str_to_dir(".", &fs.dir);
|
|
||||||
strcpy(fs.type, "");
|
|
||||||
strcpy(fs.name, "*.*");
|
|
||||||
strcpy(fs.creator, "GOLEM");
|
|
||||||
|
|
||||||
xvt_fsys_save_dir();
|
|
||||||
FL_STATUS ok = xvt_dm_post_file_open(&fs, "Selezionare il file ...");
|
|
||||||
if (ok == FL_OK)
|
|
||||||
{
|
|
||||||
xvt_fsys_restore_dir();
|
|
||||||
|
|
||||||
TFilename file;
|
|
||||||
xvt_fsys_convert_dir_to_str(&fs.dir, file.get_buffer(), file.size());
|
|
||||||
file.add(fs.name);
|
|
||||||
file.ext(fs.type);
|
|
||||||
f.set(file);
|
|
||||||
k = K_TAB;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (k == K_TAB && f.focusdirty())
|
|
||||||
{
|
|
||||||
TFilename file = m.get(S_FILE);
|
|
||||||
if (fexist(file))
|
|
||||||
{
|
|
||||||
char ext[_MAX_EXT];
|
|
||||||
char name[_MAX_FNAME];
|
|
||||||
_splitpath(file, NULL, NULL, name, ext);
|
|
||||||
file = name; file.ext(ext);
|
|
||||||
m.enable(S_LINK);
|
|
||||||
m.disable(F_NEWREC);
|
|
||||||
m.enable(F_LINK);
|
|
||||||
m.enable(F_PRINT);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const bool full = file.not_empty();
|
|
||||||
m.set(S_LINK, full ? "X" : "");
|
|
||||||
m.disable(S_LINK);
|
|
||||||
m.enable(F_NEWREC, full);
|
|
||||||
m.enable(F_LINK, full);
|
|
||||||
m.disable(F_PRINT);
|
|
||||||
file.cut(0);
|
|
||||||
}
|
|
||||||
m.set(S_ALIAS, file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool link_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_SPACE)
|
|
||||||
{
|
|
||||||
TMask& m = f.mask();
|
|
||||||
TFilename url = m.get(S_FILE);
|
|
||||||
short id = f.dlg();
|
|
||||||
if (id == F_NEWREC && url.not_empty())
|
|
||||||
{
|
|
||||||
if (!fexist(url))
|
|
||||||
{
|
|
||||||
TFilename name;
|
|
||||||
char ext[_MAX_EXT];
|
|
||||||
_splitpath(url, NULL, NULL, name.get_buffer(), ext);
|
|
||||||
if (name.not_empty() && *ext)
|
|
||||||
{
|
|
||||||
name.ext(ext);
|
|
||||||
url.tempdir();
|
|
||||||
url.add(name);
|
|
||||||
ofstream out(url); // Crea un file vuoto
|
|
||||||
}
|
|
||||||
else
|
|
||||||
url.cut(0);
|
|
||||||
m.set(S_FILE, url, TRUE); // ... memorizza il suo nome ...
|
|
||||||
m.reset(S_LINK); // Non puo' essere un collegamento
|
|
||||||
}
|
|
||||||
else
|
|
||||||
id = F_LINK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.not_empty())
|
|
||||||
{
|
|
||||||
bool open = TRUE;
|
|
||||||
if (id == DLG_PRINT)
|
|
||||||
open = !print_url(url);
|
|
||||||
if (open)
|
|
||||||
goto_url(url);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool main_link_handler(TMask_field& f, KEY k)
|
|
||||||
{
|
|
||||||
if (k == K_SPACE)
|
|
||||||
{
|
|
||||||
TSheet_field& sheet = f.mask().sfield(F_SHEET);
|
|
||||||
if (sheet.items() > 0)
|
|
||||||
{
|
|
||||||
sheet.check_row(sheet.selected());
|
|
||||||
TMask& sm = sheet.sheet_mask();
|
|
||||||
TMask_field& link = sm.field(f.dlg());
|
|
||||||
link_handler(link, K_SPACE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TGolem_field::on_key(KEY key)
|
bool TGolem_field::on_key(KEY key)
|
||||||
{
|
{
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
if (key == K_SPACE)
|
if (key == K_SPACE)
|
||||||
{
|
{
|
||||||
TMask* msk = new TMask("bagn006");
|
TMask* msk = new TGolem_mask;
|
||||||
TSheet_field& sheet = msk->sfield(F_SHEET);
|
TSheet_field& sheet = msk->sfield(F_SHEET);
|
||||||
|
|
||||||
TMask& sm = sheet.sheet_mask();
|
|
||||||
sm.set_handler(S_FILE, file_handler);
|
|
||||||
sm.set_handler(F_NEWREC, link_handler);
|
|
||||||
sm.set_handler(F_LINK, link_handler);
|
|
||||||
sm.set_handler(F_PRINT, link_handler);
|
|
||||||
|
|
||||||
TToken_string tmp = get();
|
TToken_string tmp = get();
|
||||||
|
|
||||||
if (roman())
|
if (roman())
|
||||||
{
|
{
|
||||||
tmp.separator('\n');
|
tmp.separator('\n');
|
||||||
@ -440,9 +517,6 @@ bool TGolem_field::on_key(KEY key)
|
|||||||
if (*row > ' ')
|
if (*row > ' ')
|
||||||
sheet.row(-1) = row;
|
sheet.row(-1) = row;
|
||||||
}
|
}
|
||||||
msk->set_handler(F_NEWREC, main_link_handler);
|
|
||||||
msk->set_handler(F_LINK, main_link_handler);
|
|
||||||
msk->set_handler(F_PRINT, main_link_handler);
|
|
||||||
if (msk->run() == K_ENTER)
|
if (msk->run() == K_ENTER)
|
||||||
{
|
{
|
||||||
tmp.cut(0);
|
tmp.cut(0);
|
||||||
@ -457,6 +531,7 @@ bool TGolem_field::on_key(KEY key)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
TMask& sm = sheet.sheet_mask();
|
||||||
for (int i = 0; i < 3; i++)
|
for (int i = 0; i < 3; i++)
|
||||||
sm.set(S_FILE+i, tmp.get());
|
sm.set(S_FILE+i, tmp.get());
|
||||||
|
|
||||||
|
@ -422,8 +422,6 @@ void TMask_field::set_dirty(bool d)
|
|||||||
set_focusdirty(d);
|
set_focusdirty(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Certified 100%
|
// Certified 100%
|
||||||
const char* TMask_field::prompt() const
|
const char* TMask_field::prompt() const
|
||||||
{
|
{
|
||||||
@ -1115,6 +1113,11 @@ void TButton_field::set_bmp(short up, short dn)
|
|||||||
((TPushbutton_control*)_ctl)->set_bmp(up, dn);
|
((TPushbutton_control*)_ctl)->set_bmp(up, dn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TButton_field::set_icon(word icon)
|
||||||
|
{
|
||||||
|
((TPushbutton_control*)_ctl)->set_icon(icon);
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TEditable_field
|
// TEditable_field
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -524,6 +524,7 @@ public:
|
|||||||
|
|
||||||
void set_hot_key(KEY k) { _virtual_key = _exit_key = k; }
|
void set_hot_key(KEY k) { _virtual_key = _exit_key = k; }
|
||||||
void set_bmp(short up, short dn);
|
void set_bmp(short up, short dn);
|
||||||
|
void set_icon(word icon);
|
||||||
|
|
||||||
// @cmember Costruttore
|
// @cmember Costruttore
|
||||||
TButton_field(TMask* mask);
|
TButton_field(TMask* mask);
|
||||||
|
@ -57,9 +57,7 @@ static BOOLEAN event_hook(HWND hwnd,
|
|||||||
WINDOW win = cur_win();
|
WINDOW win = cur_win();
|
||||||
if (win != NULL_WIN)
|
if (win != NULL_WIN)
|
||||||
{
|
{
|
||||||
// TWindow* w = (TWindow*)xvt_vobj_get_data(win);
|
|
||||||
const KEY key = toupper(wparam)+K_CTRL;
|
const KEY key = toupper(wparam)+K_CTRL;
|
||||||
// w->on_key(key);
|
|
||||||
dispatch_e_char(win, key);
|
dispatch_e_char(win, key);
|
||||||
*ret = 2 << 8;
|
*ret = 2 << 8;
|
||||||
}
|
}
|
||||||
@ -72,10 +70,10 @@ static BOOLEAN event_hook(HWND hwnd,
|
|||||||
{
|
{
|
||||||
KEY k = K_F1;
|
KEY k = K_F1;
|
||||||
int sc = GetAsyncKeyState(VK_CONTROL); // Stato del tasto control
|
int sc = GetAsyncKeyState(VK_CONTROL); // Stato del tasto control
|
||||||
if (sc & 1) k += K_CTRL;
|
if (sc & 0x8000) k += K_CTRL;
|
||||||
|
|
||||||
int ss = GetAsyncKeyState(VK_SHIFT); // Stato del tasto shift
|
int ss = GetAsyncKeyState(VK_SHIFT); // Stato del tasto shift
|
||||||
if (ss & 1) k += K_SHIFT;
|
if (ss & 0x8000) k += K_SHIFT;
|
||||||
|
|
||||||
WINDOW win = cur_win();
|
WINDOW win = cur_win();
|
||||||
if (win != NULL_WIN)
|
if (win != NULL_WIN)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user