Patch level : 2.2
Files correlati : Ricompilazione Demo : [ ] Commento : Sfruttate nuove funzioni di xvaga git-svn-id: svn://10.65.10.50/trunk@13371 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
308c49623d
commit
9a2a53a6d7
150
ba/ba0100.cpp
150
ba/ba0100.cpp
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <automask.h>
|
#include <automask.h>
|
||||||
#include <config.h>
|
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <controls.h>
|
#include <controls.h>
|
||||||
#include <dongle.h>
|
#include <dongle.h>
|
||||||
@ -10,7 +9,6 @@
|
|||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <recarray.h>
|
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
@ -57,7 +55,7 @@ class TMenu_application : public TSkeleton_application
|
|||||||
static bool _find_button;
|
static bool _find_button;
|
||||||
|
|
||||||
protected: // TApplication
|
protected: // TApplication
|
||||||
virtual bool create();
|
virtual bool user_create();
|
||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
virtual bool menu(MENU_TAG m);
|
virtual bool menu(MENU_TAG m);
|
||||||
virtual long handler(WINDOW win, EVENT* ep);
|
virtual long handler(WINDOW win, EVENT* ep);
|
||||||
@ -295,11 +293,16 @@ TPicture_mask::~TPicture_mask()
|
|||||||
class TExplorer_mask : public TMask
|
class TExplorer_mask : public TMask
|
||||||
{
|
{
|
||||||
TMenu_tree _tree;
|
TMenu_tree _tree;
|
||||||
|
bool _spider;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool stop_run(KEY k);
|
virtual bool stop_run(KEY k);
|
||||||
virtual bool on_key(KEY k);
|
virtual bool on_key(KEY k);
|
||||||
virtual void on_idle();
|
virtual void on_idle();
|
||||||
|
virtual void update();
|
||||||
|
virtual void handler(WINDOW win, EVENT* ep);
|
||||||
|
void draw_spider(int mode, const PNT& mouse) const;
|
||||||
|
|
||||||
static bool explore_handler(TMask_field& f, KEY k);
|
static bool explore_handler(TMask_field& f, KEY k);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -307,6 +310,12 @@ public:
|
|||||||
~TExplorer_mask();
|
~TExplorer_mask();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void TExplorer_mask::handler(WINDOW win, EVENT* ep)
|
||||||
|
{
|
||||||
|
if (ep->type == E_MOUSE_MOVE && _spider)
|
||||||
|
draw_spider(0x3, ep->v.mouse.where);
|
||||||
|
TMask::handler(win, ep);
|
||||||
|
}
|
||||||
|
|
||||||
bool TExplorer_mask::stop_run(KEY k)
|
bool TExplorer_mask::stop_run(KEY k)
|
||||||
{
|
{
|
||||||
@ -317,6 +326,7 @@ bool TExplorer_mask::stop_run(KEY k)
|
|||||||
{
|
{
|
||||||
if (ADVANCED_GRAPHICS)
|
if (ADVANCED_GRAPHICS)
|
||||||
{
|
{
|
||||||
|
const int divider = 8;
|
||||||
WINDOW window[3];
|
WINDOW window[3];
|
||||||
XVT_IMAGE image[3];
|
XVT_IMAGE image[3];
|
||||||
int i;
|
int i;
|
||||||
@ -330,7 +340,7 @@ bool TExplorer_mask::stop_run(KEY k)
|
|||||||
default: w = win(); break;
|
default: w = win(); break;
|
||||||
}
|
}
|
||||||
RCT rct; xvt_vobj_get_client_rect(w, &rct);
|
RCT rct; xvt_vobj_get_client_rect(w, &rct);
|
||||||
RCT irct = rct; irct.right /= 4; irct.bottom /= 4;
|
RCT irct = rct; irct.right /= divider; irct.bottom /= divider;
|
||||||
XVT_IMAGE cap = xvt_image_capture(w, &rct);
|
XVT_IMAGE cap = xvt_image_capture(w, &rct);
|
||||||
XVT_IMAGE img = xvt_image_create(XVT_IMAGE_RGB, irct.right, irct.bottom, 0);
|
XVT_IMAGE img = xvt_image_create(XVT_IMAGE_RGB, irct.right, irct.bottom, 0);
|
||||||
xvt_image_transfer(img, cap, &irct, &rct);
|
xvt_image_transfer(img, cap, &irct, &rct);
|
||||||
@ -353,10 +363,12 @@ bool TExplorer_mask::stop_run(KEY k)
|
|||||||
for (i = 2; i >= 0; i--)
|
for (i = 2; i >= 0; i--)
|
||||||
{
|
{
|
||||||
RCT rct; xvt_vobj_get_client_rect(window[i], &rct);
|
RCT rct; xvt_vobj_get_client_rect(window[i], &rct);
|
||||||
RCT irct = rct; irct.right /= 4; irct.bottom /= 4;
|
RCT irct = rct; irct.right /= divider; irct.bottom /= divider;
|
||||||
xvt_dwin_draw_image(window[i], image[i], &rct, &irct);
|
xvt_dwin_draw_image(window[i], image[i], &rct, &irct);
|
||||||
xvt_image_destroy(image[i]);
|
|
||||||
}
|
}
|
||||||
|
// Butto via le immagini dopo averle disegnate tutte
|
||||||
|
for (i = 2; i >= 0; i--)
|
||||||
|
xvt_image_destroy(image[i]);
|
||||||
|
|
||||||
if (sys_dll_changed()) //se e' stato installato SY..
|
if (sys_dll_changed()) //se e' stato installato SY..
|
||||||
xvt_sys_sleep(1000); //..aspetta un secondo poi forza l'uscita
|
xvt_sys_sleep(1000); //..aspetta un secondo poi forza l'uscita
|
||||||
@ -384,6 +396,83 @@ void TExplorer_mask::on_idle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TExplorer_mask::draw_spider(int mode, const PNT& mouse) const
|
||||||
|
{
|
||||||
|
WINDOW w = win();
|
||||||
|
RCT client; xvt_vobj_get_client_rect(w, &client);
|
||||||
|
const PNT p0 = { client.bottom-20, client.right-60 }; // Centro del ragno
|
||||||
|
|
||||||
|
if (mode & 0x1)
|
||||||
|
{
|
||||||
|
// Disegno il filo
|
||||||
|
const PNT p1 = { p0.v-300, p0.h };
|
||||||
|
xvt_dwin_set_std_cpen(w, TL_PEN_LTGRAY);
|
||||||
|
xvt_dwin_draw_set_pos(w, p0); xvt_dwin_draw_line(w, p1);
|
||||||
|
|
||||||
|
// Disegno il corpicino
|
||||||
|
xvt_dwin_set_std_cpen(w, TL_PEN_BLACK);
|
||||||
|
xvt_dwin_set_std_cbrush(w, TL_BRUSH_BLACK);
|
||||||
|
RCT rct; xvt_rect_set(&rct, p0.h-20, p0.v-10, p0.h+20, p0.v+10);
|
||||||
|
xvt_dwin_draw_oval(w, &rct);
|
||||||
|
|
||||||
|
// Disegno le 4 paia di zampette
|
||||||
|
const int leg = 20;
|
||||||
|
const int foot = 10;
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
PNT p[8];
|
||||||
|
p[0].h = rct.left-leg-3*i; p[0].v = rct.bottom-3*i; // Zampa sinistra
|
||||||
|
p[1].h = p[0].h+foot; p[1].v = p[0].v;
|
||||||
|
p[2].h = p[0].h; p[2].v = p[0].v-leg-3*i;
|
||||||
|
p[3] = p0; // Centro del corpo
|
||||||
|
p[4].h = 2*p0.h-p[2].h; p[4].v = p[2].v; // Zampa destra simmetrica
|
||||||
|
p[5].h = 2*p0.h-p[1].h; p[5].v = p[1].v;
|
||||||
|
p[6].h = 2*p0.h-p[0].h; p[6].v = p[0].v;
|
||||||
|
xvt_dwin_draw_polyline(w, p, 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mode & 0x2)
|
||||||
|
{
|
||||||
|
const int eye = 7;
|
||||||
|
const int pupil = 3;
|
||||||
|
RCT rct; // rettangolo jolly
|
||||||
|
|
||||||
|
// Disegno gli occhietti
|
||||||
|
xvt_dwin_set_std_cpen(w, TL_PEN_BLACK);
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
// Calcolo il centro dell'occhietto
|
||||||
|
const PNT p1 = { p0.v-eye, i == 0 ? p0.h-(5*eye/4) : p0.h+(5*eye/4) };
|
||||||
|
// Disegno il bulbo
|
||||||
|
xvt_rect_set(&rct, p1.h-eye, p1.v-eye, p1.h+eye, p1.v+eye);
|
||||||
|
xvt_dwin_set_std_cbrush(w, TL_BRUSH_WHITE);
|
||||||
|
xvt_dwin_draw_oval(w, &rct);
|
||||||
|
// Disegno la pupilla
|
||||||
|
const int dx = mouse.h <= rct.left ? -pupil : (mouse.h >= rct.right ? +pupil : 0);
|
||||||
|
const int dy = mouse.v <= rct.top ? -pupil : (mouse.v >= rct.bottom ? +pupil : 0);
|
||||||
|
xvt_rect_set(&rct, p1.h-pupil+dx, p1.v-pupil+dy, p1.h+pupil+dx, p1.v+pupil+dy);
|
||||||
|
xvt_dwin_set_std_cbrush(w, TL_BRUSH_BLACK);
|
||||||
|
xvt_dwin_draw_oval(w, &rct);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disegno la boccuccia aperta se gli occhi sono incrociati
|
||||||
|
xvt_dwin_set_std_cbrush(w, abs(mouse.h-p0.h) <= 2 ? TL_BRUSH_WHITE : TL_BRUSH_BLACK);
|
||||||
|
xvt_rect_set(&rct, p0.h-eye, p0.v, p0.h+eye, p0.v+eye);
|
||||||
|
xvt_dwin_draw_oval(w, &rct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TExplorer_mask::update()
|
||||||
|
{
|
||||||
|
TMask::update();
|
||||||
|
|
||||||
|
if (_spider)
|
||||||
|
{
|
||||||
|
const PNT pnt = { 0, 0 };
|
||||||
|
draw_spider(0x3, pnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool TExplorer_mask::on_key(KEY k)
|
bool TExplorer_mask::on_key(KEY k)
|
||||||
{
|
{
|
||||||
if (k == K_F3 || k == K_F8)
|
if (k == K_F3 || k == K_F8)
|
||||||
@ -414,6 +503,8 @@ bool TExplorer_mask::explore_handler(TMask_field& f, KEY k)
|
|||||||
TExplorer_mask::TExplorer_mask(TMenu& menu)
|
TExplorer_mask::TExplorer_mask(TMenu& menu)
|
||||||
: TMask ("", 1, 0, 0, 0, 0), _tree(menu)
|
: TMask ("", 1, 0, 0, 0, 0), _tree(menu)
|
||||||
{
|
{
|
||||||
|
_spider = ADVANCED_GRAPHICS && is_power_station();
|
||||||
|
|
||||||
const int margin = (columns()-80) / 2;
|
const int margin = (columns()-80) / 2;
|
||||||
const int tree_width = margin+21; // Usa la metà di sinistra
|
const int tree_width = margin+21; // Usa la metà di sinistra
|
||||||
|
|
||||||
@ -588,7 +679,7 @@ void TColor_mask::update()
|
|||||||
line(x+1, y+h-1, x+w-2, y+h-1);
|
line(x+1, y+h-1, x+w-2, y+h-1);
|
||||||
line(x+w-2, y+h-1, x+w-2, y);
|
line(x+w-2, y+h-1, x+w-2, y);
|
||||||
|
|
||||||
set_opaque_text(FALSE);
|
set_opaque_text(false);
|
||||||
set_pen(p = get_color_entry("Normal"));
|
set_pen(p = get_color_entry("Normal"));
|
||||||
set_brush(b = get_color_entry("NormalBack"));
|
set_brush(b = get_color_entry("NormalBack"));
|
||||||
frame(x+3, y+1, x+w-3, y+2, 0);
|
frame(x+3, y+1, x+w-3, y+2, 0);
|
||||||
@ -688,7 +779,7 @@ COLOR TColor_mask::cid2color(short cid) const
|
|||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int TMenu_application::_last_button = 0;
|
int TMenu_application::_last_button = 0;
|
||||||
bool TMenu_application::_find_button = FALSE;
|
bool TMenu_application::_find_button = false;
|
||||||
|
|
||||||
bool TMenu_application::test_assistance_year() const
|
bool TMenu_application::test_assistance_year() const
|
||||||
{
|
{
|
||||||
@ -700,7 +791,7 @@ bool TMenu_application::menu_item_handler(TMask_field&f, KEY k)
|
|||||||
if (k == K_SPACE)
|
if (k == K_SPACE)
|
||||||
{
|
{
|
||||||
app()._menu.select(f.dlg()-101);
|
app()._menu.select(f.dlg()-101);
|
||||||
f.set_focusdirty(FALSE);
|
f.set_focusdirty(false);
|
||||||
return f.mask().stop_run(K_AUTO_ENTER);
|
return f.mask().stop_run(K_AUTO_ENTER);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -716,13 +807,13 @@ bool TMenu_application::menu_find_handler(TMask_field&f, KEY k)
|
|||||||
TPicture_mask& m = (TPicture_mask&)f.mask();
|
TPicture_mask& m = (TPicture_mask&)f.mask();
|
||||||
if (app()._menu.find_string(v))
|
if (app()._menu.find_string(v))
|
||||||
{
|
{
|
||||||
f.set_focusdirty(FALSE);
|
f.set_focusdirty(false);
|
||||||
return m.stop_run(K_F9);
|
return m.stop_run(K_F9);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
beep();
|
beep();
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -862,10 +953,7 @@ bool TMenu_application::check_user()
|
|||||||
|
|
||||||
TMask m("ba0100a");
|
TMask m("ba0100a");
|
||||||
|
|
||||||
char hostname[256]; xvt_sys_get_host_name(hostname, sizeof(hostname));
|
if (is_power_station())
|
||||||
if (strcmp(hostname, "BATMOBILE") == 0 || strcmp(hostname, "ARCHIMEDE") == 0 ||
|
|
||||||
strcmp(hostname, "KIRK") == 0 || strcmp(hostname, "SPOCK") == 0 ||
|
|
||||||
strcmp(hostname, "UHURA") == 0)
|
|
||||||
{
|
{
|
||||||
m.set_handler(F_USER, pwd_handler);
|
m.set_handler(F_USER, pwd_handler);
|
||||||
m.set_handler(F_PASSWORD, pwd_handler);
|
m.set_handler(F_PASSWORD, pwd_handler);
|
||||||
@ -875,8 +963,8 @@ bool TMenu_application::check_user()
|
|||||||
e.browse()->set_filter("ISGROUP!=\"X\"");
|
e.browse()->set_filter("ISGROUP!=\"X\"");
|
||||||
|
|
||||||
TString pwd;
|
TString pwd;
|
||||||
bool ok = FALSE;
|
bool ok = false;
|
||||||
for (int i = 0 ; i < 3 && !ok; i++)
|
for (int i = 0; i < 3 && !ok; i++)
|
||||||
{
|
{
|
||||||
if (utente.not_empty() && utente != dongle().administrator())
|
if (utente.not_empty() && utente != dongle().administrator())
|
||||||
{
|
{
|
||||||
@ -1018,7 +1106,7 @@ static int get_module_version(TConfig& cfg, void* jolly)
|
|||||||
tok->add(cfg.get("Patch"));
|
tok->add(cfg.get("Patch"));
|
||||||
map.add(p, tok);
|
map.add(p, tok);
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::test_network()
|
bool TMenu_application::test_network()
|
||||||
@ -1033,8 +1121,8 @@ bool TMenu_application::test_programs()
|
|||||||
{
|
{
|
||||||
TToken_string dangerous;
|
TToken_string dangerous;
|
||||||
|
|
||||||
bool test = FALSE;
|
bool test = false;
|
||||||
bool more = FALSE;
|
bool more = false;
|
||||||
{
|
{
|
||||||
TConfig prawin(CONFIG_INSTALL, "Main");
|
TConfig prawin(CONFIG_INSTALL, "Main");
|
||||||
test = prawin.get_bool("TestPrograms");
|
test = prawin.get_bool("TestPrograms");
|
||||||
@ -1048,7 +1136,7 @@ bool TMenu_application::test_programs()
|
|||||||
|
|
||||||
if (remote_name.exist())
|
if (remote_name.exist())
|
||||||
{
|
{
|
||||||
TProgind pi(3, TR("Controllo aggiornamento programmi"), FALSE, TRUE);
|
TProgind pi(3, TR("Controllo aggiornamento programmi"), false, TRUE);
|
||||||
TConfig remote_install(remote_name, "Main");
|
TConfig remote_install(remote_name, "Main");
|
||||||
remote_install.write_protect();
|
remote_install.write_protect();
|
||||||
|
|
||||||
@ -1122,10 +1210,10 @@ bool TMenu_application::test_programs()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TMenu_application::create()
|
bool TMenu_application::user_create()
|
||||||
{
|
{
|
||||||
if (!test_network())
|
if (!test_network())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
disable_menu_item(M_FILE_PRINT); // Questa voce di menu non serve per ora
|
disable_menu_item(M_FILE_PRINT); // Questa voce di menu non serve per ora
|
||||||
|
|
||||||
@ -1143,7 +1231,7 @@ bool TMenu_application::create()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!check_user())
|
if (!check_user())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (!TApplication::test_assistance_year())
|
if (!TApplication::test_assistance_year())
|
||||||
{
|
{
|
||||||
@ -1155,7 +1243,7 @@ bool TMenu_application::create()
|
|||||||
test_temp();
|
test_temp();
|
||||||
|
|
||||||
if (!test_programs())
|
if (!test_programs())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
if (!_menu.ok())
|
if (!_menu.ok())
|
||||||
{
|
{
|
||||||
@ -1164,8 +1252,6 @@ bool TMenu_application::create()
|
|||||||
menu.ext("men");
|
menu.ext("men");
|
||||||
_menu.read(menu);
|
_menu.read(menu);
|
||||||
update_preferred_tree();
|
update_preferred_tree();
|
||||||
|
|
||||||
TSkeleton_application::create();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1200,7 +1286,7 @@ bool TMenu_application::destroy()
|
|||||||
|
|
||||||
void TMenu_application::main_loop()
|
void TMenu_application::main_loop()
|
||||||
{
|
{
|
||||||
bool run = TRUE;
|
bool run = user_create();
|
||||||
while (run)
|
while (run)
|
||||||
{
|
{
|
||||||
int m = 0;
|
int m = 0;
|
||||||
@ -1690,7 +1776,7 @@ bool TPreferred_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
|||||||
switch (e)
|
switch (e)
|
||||||
{
|
{
|
||||||
case se_query_add:
|
case se_query_add:
|
||||||
return FALSE;
|
return false;
|
||||||
case se_enter:
|
case se_enter:
|
||||||
enable(F_PREF_UP, jolly > 0);
|
enable(F_PREF_UP, jolly > 0);
|
||||||
enable(F_PREF_DN, jolly < ((TSheet_field&)o).items()-1);
|
enable(F_PREF_DN, jolly < ((TSheet_field&)o).items()-1);
|
||||||
@ -1732,7 +1818,7 @@ bool TPreferred_mask::on_field_event(TOperable_field& o, TField_event e, long jo
|
|||||||
const int r = sf.selected();
|
const int r = sf.selected();
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
sf.destroy(r);
|
sf.destroy(r);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1834,7 +1920,7 @@ bool TMenu_application::menu(MENU_TAG mt)
|
|||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
switch (mt)
|
switch (mt)
|
||||||
{
|
{
|
||||||
case BAR_ITEM(1): main_loop(); ok = FALSE; break;
|
case BAR_ITEM(1): main_loop(); ok = false; break;
|
||||||
case MENU_ITEM(2): choose_colors(); break;
|
case MENU_ITEM(2): choose_colors(); break;
|
||||||
case MENU_ITEM(3): choose_editors(); break;
|
case MENU_ITEM(3): choose_editors(); break;
|
||||||
case MENU_ITEM(4): choose_study(); break;
|
case MENU_ITEM(4): choose_study(); break;
|
||||||
@ -1843,7 +1929,7 @@ bool TMenu_application::menu(MENU_TAG mt)
|
|||||||
default:
|
default:
|
||||||
if (mt >= MENU_ITEM(50) && mt < MENU_ITEM(50+_preferred.items()))
|
if (mt >= MENU_ITEM(50) && mt < MENU_ITEM(50+_preferred.items()))
|
||||||
{
|
{
|
||||||
bool ok = FALSE;
|
bool ok = false;
|
||||||
const int index = mt - MENU_ITEM(50);
|
const int index = mt - MENU_ITEM(50);
|
||||||
TToken_string node(_preferred.row(index).get(1), '/');
|
TToken_string node(_preferred.row(index).get(1), '/');
|
||||||
if (_tree_view != 0)
|
if (_tree_view != 0)
|
||||||
|
@ -472,7 +472,7 @@ void TMenulist_window::draw_item(int i)
|
|||||||
const int width = rct.right - rct.left;
|
const int width = rct.right - rct.left;
|
||||||
const int height = rct.bottom - rct.top;
|
const int height = rct.bottom - rct.top;
|
||||||
|
|
||||||
xvt_set_font(win(), NULL, 0, 0); // Set default font
|
xvtil_set_font(win(), NULL, 0, 0); // Set default font
|
||||||
set_opaque_text(TRUE);
|
set_opaque_text(TRUE);
|
||||||
|
|
||||||
const TMenuitem& item = (const TMenuitem&)_sorted[i];
|
const TMenuitem& item = (const TMenuitem&)_sorted[i];
|
||||||
@ -673,13 +673,13 @@ void TMenulist_window::click_on(int index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenulist_window::handler(WINDOW win, EVENT* ep)
|
void TMenulist_window::handler(WINDOW w, EVENT* ep)
|
||||||
{
|
{
|
||||||
switch (ep->type)
|
switch (ep->type)
|
||||||
{
|
{
|
||||||
case E_MOUSE_DOWN:
|
case E_MOUSE_DOWN:
|
||||||
{
|
{
|
||||||
RCT rct; xvt_vobj_get_client_rect(win, &rct);
|
RCT rct; xvt_vobj_get_client_rect(w, &rct);
|
||||||
const int row = ep->v.mouse.where.v * MENU_ROWS / rct.bottom;
|
const int row = ep->v.mouse.where.v * MENU_ROWS / rct.bottom;
|
||||||
const int col = ep->v.mouse.where.h * MENU_COLS / rct.right;
|
const int col = ep->v.mouse.where.h * MENU_COLS / rct.right;
|
||||||
const int index = row * MENU_COLS + col;
|
const int index = row * MENU_COLS + col;
|
||||||
@ -702,11 +702,19 @@ void TMenulist_window::handler(WINDOW win, EVENT* ep)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case E_MOUSE_MOVE:
|
||||||
|
if (ADVANCED_GRAPHICS)
|
||||||
|
{
|
||||||
|
EVENT e = *ep;
|
||||||
|
xvt_vobj_translate_points(w, parent(), &e.v.mouse.where, 1);
|
||||||
|
xvt_win_dispatch_event(parent(), &e);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
TField_window::handler(win, ep);
|
TField_window::handler(w, ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TMenulist_window::select(int s, int direction)
|
void TMenulist_window::select(int s, int direction)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user