Corretti errori focus e sheet

git-svn-id: svn://10.65.10.50/trunk@3091 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1996-06-27 07:15:21 +00:00
parent d043b6d9cb
commit 853ee0f2df
16 changed files with 310 additions and 85 deletions

View File

@ -346,10 +346,18 @@ TAssoc_array & TAssoc_array::copy(
const TAssoc_array & a) // @parm Array associativo sorgente
{
/* Guy mai vista 'na roba piu' orenda: non distrugge nemmeno i contenuti attuali!
CHECK(_new_assoc_array == NULL, "Trying to duplicate an assoc array while another copy is in progress");
_new_assoc_array = this;
((TAssoc_array &)a).for_each(copia_elemento);
_new_assoc_array = NULL;
*/
destroy();
TAssoc_array& from = (TAssoc_array&)a;
from.restart();
for (THash_object* obj = from.get_hashobj(); obj; obj = from.get_hashobj())
add(obj->key(), obj->obj(), TRUE);
return * this;
}

View File

@ -385,7 +385,7 @@ HIDDEN void xi_event_handler(XI_OBJ* itf, XI_EVENT* xiev)
ctl = (TControl*)xi_get_app_data(xiev->v.xi_obj);
else
ctl = (TControl*)xi_get_app_data(xiev->v.xi_obj->parent);
break;
break;
case a_xvt:
if (xiev->v.xvte.type == E_CHAR)
{
@ -408,7 +408,6 @@ HIDDEN void xi_event_handler(XI_OBJ* itf, XI_EVENT* xiev)
{
XI_OBJ * obj = xi_get_focus(itf);
if ((obj != NULL && obj->type != XIT_ITF))
{
if ((obj->type == XIT_CELL || (obj->type == XIT_BTN && obj->v.btn->type == XIBT_RADIOBTN)))
@ -467,59 +466,120 @@ XI_OBJ* TControl::get_interface(WINDOW win) const
return itf;
}
void TControl::set_tab_cid(short cid)
void TControl::set_tab_cid(XI_OBJ* obj, short cid) const
{
CHECK(_obj, "Can't update tab_cid of a NULL control");
switch(_obj->type)
CHECK(obj, "Can't set tab cid to null control");
switch(obj->type)
{
case XIT_BTN:
_obj->v.btn->tab_cid = cid; break;
obj->v.btn->tab_cid = cid;
break;
case XIT_CONTAINER:
_obj->v.container->tab_cid = _obj->cid;
if (_obj->nbr_children > 0)
_obj->children[_obj->nbr_children-1]->v.btn->tab_cid = cid;
obj->v.container->tab_cid = cid;
break;
case XIT_FIELD:
_obj->v.field->tab_cid = cid;
_obj->parent->v.form->tab_cid = _obj->parent->cid;
obj->v.field->tab_cid = cid;
break;
case XIT_FORM:
obj->v.form->tab_cid = cid;
break;
case XIT_LIST:
_obj->v.list->tab_cid = cid; break;
obj->v.list->tab_cid = cid; break;
default:
NFCHECK(0, "Can't set tab_cid to a static control: ", _obj->cid); break;
}
}
TControl& TControl::find_operable_ctl(bool forward) const
HIDDEN bool is_container(const XI_OBJ* obj)
{
int num;
XI_OBJ** child = xi_get_member_list(get_interface(), &num);
return obj->type == XIT_CONTAINER || obj->type == XIT_FORM || obj->type == XIT_GROUP;
}
XI_OBJ* TControl::find_operable(XI_OBJ* container, bool forward, bool normal) const
{
int num;
XI_OBJ** child = xi_get_member_list(container, &num);
CHECK(num > 0, "Container too empty");
const int first = forward ? 0 : num-2;
const int last = forward ? num-1 : -1;
const int delta = forward ? +1 : -1;
XI_OBJ* obj = NULL;
for (int c = first; c != last && obj == NULL; c += delta)
XI_OBJ* found = NULL;
for (int c = first; c != last && found == NULL; c += delta)
{
const XI_OBJ_TYPE t = child[c]->type;
if (t == XIT_FORM || t == XIT_BTN || t == XIT_LIST || t == XIT_CONTAINER)
obj = child[c];
XI_OBJ* obj = child[c];
switch (obj->type)
{
case XIT_LIST:
case XIT_BTN:
case XIT_FIELD:
if (normal && obj->cid > 0)
found = obj;
break;
case XIT_CONTAINER:
case XIT_FORM:
case XIT_GROUP:
if (obj->cid > 0)
{
if (normal)
{
int num;
XI_OBJ** child = xi_get_member_list(obj, &num);
found = forward ? child[0] : child[num-1];
}
else
found = obj;
}
break;
default:
break;
}
}
TControl* ctl = obj == NULL ? (TControl*)this : (TControl*)xi_get_app_data(obj);
CHECK(ctl, "Can't update NULL control");
return *ctl;
if (found == NULL)
{
found = child[num-1];
if (is_container(found) && normal)
{
int num;
XI_OBJ** child = xi_get_member_list(found, &num);
found = forward ? child[0] : child[num-1];
}
}
return found;
}
void TControl::update_tab_cid()
{
TControl& lc = find_operable_ctl(FALSE);
lc.set_tab_cid(id());
{
const bool is_cont = is_container(_obj);
XI_OBJ *first = find_operable(_obj->itf, TRUE, !is_cont);
set_tab_cid(_obj, first->cid);
XI_OBJ *last = find_operable(_obj->itf, FALSE, !is_cont);
set_tab_cid(last, _obj->cid);
const TControl& fc = find_operable_ctl(TRUE);
set_tab_cid(fc.id());
if (is_cont)
{
XI_OBJ* first = find_operable(_obj->itf, TRUE, TRUE);
XI_OBJ* last = find_operable(_obj->itf, FALSE, TRUE);
int num;
XI_OBJ** child = xi_get_member_list(_obj, &num);
set_tab_cid(child[num-1], first->cid);
set_tab_cid(last, child[0]->cid);
} else
if (_obj->parent != _obj->itf)
{
XI_OBJ* first = find_operable(_obj->itf, TRUE, FALSE);
XI_OBJ* last = find_operable(_obj->itf, FALSE, FALSE);
set_tab_cid(_obj->parent, first->cid);
set_tab_cid(last, _obj->parent->cid);
}
}
void TControl::coord2rct(WINDOW win, short x, short y, short dx, short dy, XI_RCT& rct) const
{
// Spazio da lasciare prima di toccare i bordi
@ -890,7 +950,7 @@ void TField_control::create(WINDOW win, short cid,
{
in_create = TRUE;
const short fcid = cid + 1000;
const short fcid = cid > 0 ? cid + 1000 : cid - 1000;
XI_OBJ_DEF* frm_def = xi_add_form_def(NULL, fcid, fcid);
frm_def->app_data = (long)this;
@ -929,8 +989,8 @@ void TField_control::create(WINDOW win, short cid,
CHECKD(form, "Can't create the form for field ", cid);
_obj = xi_get_obj(form, cid);
CHECKD(_obj, "Can't create field ", cid);
STX_DATA * stx = (STX_DATA*)_obj->v.field->stx;
STX_DATA* stx = (STX_DATA*)_obj->v.field->stx;
CHECKD(stx, "NULL stx for field ", cid);
const int offset = _obj->v.field->btn_rct.left - stx->rct.right + 1;
_obj->v.field->btn_rct.left -= offset ;
_obj->v.field->btn_rct.right -= offset;
@ -974,8 +1034,11 @@ bool TField_control::event_handler(XI_OBJ* itf, XI_EVENT* xiev)
case XIE_CHAR_FIELD:
{
KEY k = xiev_to_key(xiev);
if (k == K_PREV || k == K_NEXT || (k >= K_CTRL+K_F1 && k <= K_CTRL+K_F12))
if (k == K_PREV || k == K_NEXT || k > K_CTRL)
{
k = K_TAB;
xiev->refused = TRUE;
}
if (k == K_TAB || is_edit_key(k) || (k > K_F1 && k < K_F12))
ok = notify_key(k);
}
@ -1052,7 +1115,6 @@ void TButton_control::create(WINDOW win, short cid,
r.right += XI_FU_MULTIPLE / 2;
}
xi_dequeue();
xi_tree_free(def);
@ -1399,23 +1461,25 @@ TTagbutton_control::TTagbutton_control(WINDOW win, short cid,
_obj = xi_create(itf, cnt_def);
CHECKD(_obj, "Can't create tab-button container ", cid);
update_tab_cid();
xi_dequeue();
xi_tree_free(cnt_def);
}
bool TTagbutton_control::event_handler(XI_OBJ* itf, XI_EVENT* xiev)
{
bool ok = TRUE;
{
bool ok = TRUE;
if (xiev->type == XIE_BUTTON)
{
{
XI_OBJ* obj = xiev->v.xi_obj; // Elemento del gruppo di radio buttons da premere
if (!xi_is_checked(obj)) // Se e' gia' selezionato ignoralo completamente
{
if (xi_move_focus(itf)) // Controlla se si puo' cambiare pagina
{
TWindow* w = (TWindow*)xi_get_app_data(itf);
KEY k = K_CTRL + K_F1 + xiev->v.xi_obj->cid - id() - 1;
TWindow* w = (TWindow*)xi_get_app_data(itf);
const KEY k = K_CTRL + K_F1 + xiev->v.xi_obj->cid - id() - 1;
w->on_key(k);
}
}

View File

@ -48,10 +48,10 @@ protected:
XI_OBJ* get_interface(WINDOW win = NULL_WIN) const;
// @cmember Cerca un controllo operabile (in avanti o all'indietro)
TControl& find_operable_ctl(bool forward) const;
XI_OBJ* find_operable(XI_OBJ* container, bool forward, bool normal) const;
// @cmember Setta l'identificatore del prossimo controllo per il tasto TAB
void set_tab_cid(short id);
void set_tab_cid(XI_OBJ* obj, short id) const;
void coord2rct(WINDOW win, short left, short top, short width, short height, RCT& rct) const;
unsigned long flags2attr(const char* flags) const;

View File

@ -94,6 +94,7 @@ image BMP_XLS "f:/p.due/bmp/xls.bmp"
image BMP_WAV "f:/p.due/bmp/wav.bmp"
image BMP_DOC "f:/p.due/bmp/doc.bmp"
image BMP_LENTE "f:/p.due/bmp/lente.bmp"
image BMP_FAX "f:/p.due/bmp/fax.bmp"
#scan <xil.h>
#transparent $$$

View File

@ -30,6 +30,7 @@
#define DLG_SETPRINT 25 /* TAG del bottone Imposta Stampa */
#define DLG_RECALC 26 /* TAG del bottone Ricalcola */
#define DLG_F8 27 /* TAG del bottone <Ricerca zoom> */
#define DLG_FAX 28 /* TAG del bottone <Fax> */
#define DLG_USER 100 /* TAG del primo controllo definito dall'utente */
/* @M

View File

@ -302,6 +302,13 @@ HIDDEN BOOLEAN hook(HWND hwnd,
CUR_DDE->do_terminate(wparam);
normal_process = FALSE;
break;
case WM_DROPFILES:
if (CUR_DDE->do_custom_message(msg, wparam, lparam))
{
*ret = 0;
normal_process = FALSE;
}
break;
default:
if (msg > (UINT)WM_USER && msg < 0x7FFF)
{
@ -311,16 +318,15 @@ HIDDEN BOOLEAN hook(HWND hwnd,
break;
}
*ret = !normal_process;
return normal_process;
}
TDDE::TDDE()
: _server(0), _old_hook(NULL)
{
CHECK(CUR_DDE == NULL, "Non puoi lanciare due DDE, bestia!");
_hwnd = (word)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_WINDOW);
{
CHECK(CUR_DDE == NULL, "Double DDE");
CUR_DDE = this;
_hwnd = (word)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_WINDOW);
}
TDDE::~TDDE()
@ -332,16 +338,19 @@ TDDE::~TDDE()
bool TDDE::initiate(const char* app, const char* topic)
{
CHECK(_old_hook == NULL, "Non puoi iniziare due connessioni DDE");
_old_hook = xvt_vobj_get_attr(NULL_WIN, ATTR_EVENT_HOOK);
xvt_vobj_set_attr(NULL_WIN, ATTR_EVENT_HOOK, (long)hook);
if (_old_hook == NULL)
{
_old_hook = xvt_vobj_get_attr(NULL_WIN, ATTR_EVENT_HOOK);
xvt_vobj_set_attr(NULL_WIN, ATTR_EVENT_HOOK, (long)hook);
}
_server = 0;
ATOM a_app = GlobalAddAtom(app);
ATOM a_topic = GlobalAddAtom(topic);
SendMessage(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)_hwnd, MAKELPARAM(a_app, a_topic));
GlobalDeleteAtom(a_app);
GlobalDeleteAtom(a_topic);
return _server != 0;
}
@ -352,13 +361,46 @@ bool TDDE::execute(const char* cmd) const
strcpy(c, cmd);
GlobalUnlock(hg);
return PostMessage((HWND)_server, WM_DDE_EXECUTE, (WPARAM)_hwnd, MAKELPARAM(0, hg));
}
bool TDDE::execute(const char* app, const char* topic, const char* cmd, const char* filename)
{
bool running = initiate(app, topic);
if (!running)
{
if (filename == NULL || *filename == '\0')
filename = app;
TExternal_app server(filename);
if (server.run(TRUE) == 0)
{
for (int failures = 0; !running && failures < 10; failures++)
{
const clock_t end = clock() + 3*CLOCKS_PER_SEC;
while (clock() < end)
do_events();
running = initiate(app, topic);
}
}
}
if (running)
{
if (cmd && *cmd)
execute(cmd);
terminate();
}
return running;
}
bool TDDE::start_server()
{
CHECK(_old_hook == NULL, "Non puoi iniziare due connessioni DDE");
_old_hook = xvt_vobj_get_attr(NULL_WIN, ATTR_EVENT_HOOK);
xvt_vobj_set_attr(NULL_WIN, ATTR_EVENT_HOOK, (long)hook);
if (_old_hook == NULL)
{
_old_hook = xvt_vobj_get_attr(NULL_WIN, ATTR_EVENT_HOOK);
xvt_vobj_set_attr(NULL_WIN, ATTR_EVENT_HOOK, (long)hook);
}
return TRUE;
}

View File

@ -9,6 +9,10 @@
class TConfig;
#endif
#ifndef __STRINGS_H
#include <strings.h>
#endif
#ifndef __RELATION_H
class TRelation;
#endif
@ -115,9 +119,12 @@ public:
bool initiate(const char* app, const char* topic);
// @cmember Esegue il comando <p cmd>
bool execute(const char* cmd) const;
// @cmember Lancia il server ed esegue un comando
bool execute(const char* app, const char* topic, const char* cmd, const char* filename = NULL);
// @cmember Chiude la connessione
void terminate();
// @cmember Inizia a fornire i servizi di DDE server
bool start_server();

View File

@ -186,7 +186,7 @@ void TMask::open()
xvt_vobj_set_visible(toolwin(), TRUE);
}
_focus = first_focus(0);
set_focus_field(focus_field().dlg());
set_focus_field(fld(_focus).dlg());
}
int TMask::find_first_active(WINDOW p) const
@ -815,8 +815,12 @@ void TMask::next_page(
return;
}
_page = k;
} else _page = 0;
}
else
{
if (_page < 0 || _page >= _pages)
_page = 0;
}
if (_page != prev)
{
xvt_vobj_set_visible(win(), TRUE);

View File

@ -727,7 +727,8 @@ bool TSpreadsheet::off_cell_handler(XI_OBJ *cell)
ok = *nuo == '\0'; // Se e' vuoto lascia stare
else
_cell_dirty = FALSE;
mask2str(_cur_rec); // Update sheet row
if (_row_dirty)
mask2str(_cur_rec); // Update sheet row
}
return ok;
}
@ -787,7 +788,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
src = row(rec).get(col); // Set value for cell
if (src && *src)
{
if (/*maxlen == 3 && */ e->is_kind_of(CLASS_LIST_FIELD))
if (e->is_kind_of(CLASS_LIST_FIELD))
/* src = src */; // Leave code as is
else
src = e->raw2win(src); // Get formatted string

View File

@ -23,6 +23,7 @@
#include <applicat.h>
#include <config.h>
#include <execp.h>
#include <golem.h>
#include <mask.h>
#include <printer.h>
#include <printwin.h>
@ -1072,6 +1073,7 @@ TPrinter::TPrinter()
// get default printer driver
GetProfileString ("windows", "device", ",,,", defPrinter, sizeof(defPrinter));
TToken_string pdev (defPrinter, ',');
GetProfileString ("devices", pdev, "", szDevice, sizeof(szDevice));
pdev.add(szDevice);
@ -1081,13 +1083,24 @@ TPrinter::TPrinter()
CHECKS(_curprn >= 0, "Can't find printer ", (const char*)p1);
set_fincatura("+++++++++-|");
#else
_isgraphics = FALSE;
#endif
if (_isgraphics)
_finker = NULL;
else _finker = new TPrint_intersector(_fink, _formlen);
_finker = _isgraphics ? NULL : new TPrint_intersector(_fink, _formlen);
}
bool TPrinter::isfax() const
{
bool fax = _printertype == winprinter;
if (fax)
{
const char* name = (const char*)((TPrinter*)this)->get_printrcd() + 4;
TToken_string p(256, ',');
GetProfileString ("devices", name, "", (char*)(const char*)p, p.size());
fax = stricmp(p.get(1), "EASYFAX") == 0;
}
return fax;
}
TToken_string& TPrinter::getprinternames ()
@ -1157,7 +1170,6 @@ void TPrinter::read_configuration(
if (what < 0) // Se configurazione annullata ...
{
delete iniptr; iniptr = NULL;
// _config = "Printer"; // ... usa configurazione standard
}
}
if (iniptr == NULL)
@ -1687,6 +1699,9 @@ bool TPrinter::open()
// prepare text object for new text
_txt.destroy();
_txt.interactive(FALSE);
if (isfax())
start_fax_server();
}
#if XVT_OS==XVT_OS_SCOUNIX
else
@ -1904,13 +1919,16 @@ int TPrinter::set_bookmark(
void TPrinter::print_txt(TTextfile& txt)
{
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
PrintWhat._prcd = _print_rcd;
PrintWhat._txt = &txt;
PrintWhat._graphics = _isgraphics;
PrintWhat._charsize = _ch_size;
xvt_print_open();
xvt_print_start_thread (start_winprint, (long) (&PrintWhat));
xvt_print_close();
if (txt.lines() > 0)
{
PrintWhat._prcd = _print_rcd;
PrintWhat._txt = &txt;
PrintWhat._graphics = _isgraphics;
PrintWhat._charsize = _ch_size;
xvt_print_open();
xvt_print_start_thread (start_winprint, (long) (&PrintWhat));
xvt_print_close();
}
#endif
}
@ -2120,4 +2138,39 @@ const char* TPrinter::background_chars(int l) const
return _finker == NULL ? "" : _finker->get_chars(l);
}
///////////////////////////////////////////////////////////
// Gestione fax
///////////////////////////////////////////////////////////
bool TPrinter::start_fax_server() const
{
TDDE dde;
return dde.execute("EASYFAX", "FAX", "", "bafax");
}
void TPrinter::close_fax_server() const
{
TDDE dde;
const bool running = dde.initiate("EASYFAX", "FAX");
if (running)
dde.execute("[FileClose]");
}
bool TPrinter::send_fax(const char* tipo, const char* codice)
{
bool ok = isopen() && isfax();
if (ok)
{
if (tipo && codice)
{
TString cmd(80);
cmd << "[SetRecipient(" << tipo << ',' << codice << ")]";
TDDE dde;
dde.execute("EASYFAX", "FAX", cmd, "bafax");
}
close(); // termina la stampa corrente e la spedisce
open(); // riapre la stampante
}
return ok;
}

View File

@ -374,6 +374,9 @@ protected:
void save_configuration();
// @cmember Stampa il testo
void print_txt(TTextfile& txt);
// @cmember Chiude il fax server
void close_fax_server() const;
// @access Public Member
public:
@ -651,6 +654,12 @@ public:
void set_offset(int a, int b) { _l_offset=a; _c_offset=b;}
// @cmember ritorna la riga di background se si stampa in modo testo
const char* background_chars(int l) const;
// @cmember Ritorna TRUE se la stampante e' un fax
bool isfax() const;
// @cmember Lancia ik fax server
bool start_fax_server() const;
// @cmember Spedisce la stampa attuale via fax
bool send_fax(const char* tipo, const char* codice);
// @cmember Ritorna la dimensione dei caratteri da stampare
int get_char_size() const

View File

@ -37,7 +37,7 @@ const TString& TScanner::pop()
line();
_token.cut(0);
}
} while (_token.empty() && good());
} while (_token.empty() && good() && !eof());
_pushed = FALSE;
_token.upper();
@ -61,7 +61,7 @@ TString& TScanner::line(
_line++;
_token << __tmp_string;
_token.trim();
} while (_token.empty() && good());
} while (_token.empty() && good() && !eof());
_pushed = FALSE;
@ -140,7 +140,7 @@ void TScanner::push(const char* s)
bool TScanner::paragraph(const char* name)
{
TString80 p;
TString p;
p << '[' << name << ']';
seekg(0L);

View File

@ -338,9 +338,18 @@ void TSheet_control::make_current(long rec)
}
void TSheet_control::select(long rec)
{
{
if (rec >= 0 && rec < items())
xi_scroll_rec(_obj, rec, NORMAL_COLOR, XI_ATR_ENABLED, 0);
{
int rows;
const long* handle = xi_get_list_info(_obj, &rows);
int first = 0, last = 0;
xi_get_visible_rows(_obj, &first, &last);
if (rec < handle[first] || rec > handle[last])
xi_scroll_rec(_obj, rec, NORMAL_COLOR, XI_ATR_ENABLED, 0);
}
make_current(rec);
}
@ -782,6 +791,7 @@ void TSheet::start_run()
_parked = -1;
repos_buttons();
_sheet->update();
}
@ -860,11 +870,7 @@ bool TSheet::on_key(KEY key)
// @mfunc Seleziona una riga facendola diventare corrente
void TSheet::select(
long n) // @parm Riga da selezionare (default -1)
// @comm Se <p n> assume un valore minore di 1 viene selezionata la prima riga.
// <nl>Nela caso si cerci di selezionare una riga maggiore di quelle presenti
// viene selezionata l'ultima.
long n) // @parm Riga da selezionare
{
_sheet->select(n);
}
@ -998,7 +1004,10 @@ KEY TCursor_sheet::run()
{
_records = _cursor->items();
_cursor->freeze(TRUE);
select(_cursor->pos());
post_select(_cursor->pos());
const KEY k = TSheet::run();
_cursor->freeze(FALSE);
return k;
@ -1023,6 +1032,7 @@ void TCursor_sheet::get_row(long row, TToken_string& l)
///////////////////////////////////////////////////////////
HIDDEN TBrowse_sheet* _cur_browse = NULL;
HIDDEN bool _can_post = FALSE;
bool TBrowse_sheet::browse_field_handler(TMask_field& f, KEY k)
{
@ -1050,15 +1060,21 @@ bool TBrowse_sheet::browse_field_handler(TMask_field& f, KEY k)
if (k == K_F2)
rec = 0;
if (rec >= 0 && rec != _cur_browse->selected())
_cur_browse->post_select(rec);
{
_cur_browse->select(rec); // Non mettere post_select
_can_post = TRUE;
}
return TRUE;
}
bool TBrowse_sheet::last_browse_field_handler(TMask_field& f, KEY k)
{
const bool ok = browse_field_handler(f, k);
if (ok && k == K_TAB)
if (ok && k == K_TAB && _can_post)
{
_cur_browse->post_select(_cur_browse->selected());
_can_post = FALSE;
}
return ok;
}
@ -1139,8 +1155,10 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
{
e->set_handler(browse_field_handler);
e->set(c.get());
/*
if (e->dlg() == f->dlg())
first_focus(f->dlg());
*/
}
}
}

View File

@ -109,7 +109,7 @@ void* operator new(size_t size)
// <nl>Questa funzione viene implementata se non si opera in ambiante FoxPro.
{
void* mem = (void*)malloc(size);
void* mem = (void*)malloc(size);
if (mem == NULL)
fatal_box("Out of memory: can't allocate %u bytes", size);

View File

@ -36,6 +36,7 @@
#define BMP_SAVEREC 103
#define BMP_DELREC 104
#define BMP_NEWREC 105
#define BMP_FAX 108
#define BMP_SEARCH 109
#define BMP_CHECK_ON 110
#define BMP_CHECK_OFF 111

View File

@ -240,6 +240,22 @@ static BOOLEAN event_hook(HWND hwnd,
}
}
break;
case WM_KEYDOWN:
if (wparam == VK_F1)
{
if ((lparam & (1<<29)) == 0) // Il tasto alt non e' premuto
{
int sc = GetAsyncKeyState(VK_CONTROL); // Il tasto control non e' premuto
int ss = GetAsyncKeyState(VK_SHIFT); // Il tasto shift non e' premuto
if (sc == 0 && ss == 0)
{
WINDOW win = cur_win();
if (win != NULL_WIN)
dispatch_e_char(win, K_F1);
}
}
}
break;
default:
if (msg == WM_WAKEUP && wparam == main_app().waiting())
main_app().wake_up();