Patch level : 4.0

Files correlati     : ba8
Ricompilazione Demo : [ ]
Commento            :
Corretta gestione immagini grandi su alberi


git-svn-id: svn://10.65.10.50/trunk@16173 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2008-02-14 16:39:04 +00:00
parent 5f61f2fff0
commit b35f372dfc
3 changed files with 27 additions and 17 deletions

View File

@ -878,17 +878,6 @@ TTree_window::TTree_window(int x, int y, int dx, int dy,
// TControl_host_window // TControl_host_window
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
class TControl_host_window : public TField_window
{
protected:
WINDOW _ctrl;
protected:
void handler(WINDOW win, EVENT* ep);
TControl_host_window(int x, int y, int dx, int dy,
WINDOW parent, TWindowed_field* owner);
};
void TControl_host_window::handler(WINDOW win, EVENT* ep) void TControl_host_window::handler(WINDOW win, EVENT* ep)
{ {
switch (ep->type) switch (ep->type)
@ -901,6 +890,10 @@ void TControl_host_window::handler(WINDOW win, EVENT* ep)
xvt_vobj_move(_ctrl, &rct); xvt_vobj_move(_ctrl, &rct);
} }
break; break;
case E_UPDATE:
if (_ctrl != NULL_WIN)
return; // Inutile disegnare: _ctrl occupa tutta la client area
break;
default: default:
break; break;
} }
@ -968,8 +961,14 @@ bool TTree_window::add_child(XVT_TREEVIEW_NODE parent)
else else
ii = im_nor->xvt_image(); ii = im_nor->xvt_image();
XVT_TREEVIEW_NODE child = xvt_treeview_add_child_node(_ctrl, parent, type, ii, ic, ie, desc, NULL, id); XVT_TREEVIEW_NODE child = xvt_treeview_add_child_node(_ctrl, parent, type, ii, ic, ie, desc, NULL, id);
if (type == XVT_TREEVIEW_NODE_NONTERMINAL && _tree->expanded()) if (child != NULL && type == XVT_TREEVIEW_NODE_NONTERMINAL && _tree->expanded())
{
for (bool ok = _tree->goto_firstson(); ok; ok = _tree->goto_rbrother())
add_child(child);
xvt_treeview_expand_node(_ctrl, child, FALSE); xvt_treeview_expand_node(_ctrl, child, FALSE);
}
_tree->goto_node(id);
return true; return true;
} }

View File

@ -5,6 +5,18 @@
#include "maskfld.h" #include "maskfld.h"
#endif #endif
// Native control host window: autresizes its unique child control
class TControl_host_window : public TField_window
{
protected:
WINDOW _ctrl;
protected:
virtual void handler(WINDOW win, EVENT* ep);
TControl_host_window(int x, int y, int dx, int dy,
WINDOW parent, TWindowed_field* owner);
};
class TGolem_client_field : public TWindowed_field class TGolem_client_field : public TWindowed_field
{ {
TGolem_field* _driver; TGolem_field* _driver;
@ -25,7 +37,6 @@ public:
virtual ~TGolem_client_field(); virtual ~TGolem_client_field();
}; };
// Implemented in tree.cpp // Implemented in tree.cpp
class TTree; class TTree;

View File

@ -590,17 +590,17 @@ long daytime()
if (time(&lt) != -1) if (time(&lt) != -1)
{ {
struct tm * timeloc = localtime(&lt); struct tm * timeloc = localtime(&lt);
if (timeloc != NULL) if (timeloc != NULL)
t = timeloc->tm_sec + timeloc->tm_min * 100L + timeloc->tm_hour * 10000L; t = timeloc->tm_sec + timeloc->tm_min * 100L + timeloc->tm_hour * 10000L;
} }
return t; return t;
} }
bool is_power_station() bool is_power_station()
{ {
const char* ranger[] = { "ANTARES", "ARCHIMEDE", "BATMOBILE", "KIRK", "SPOCK", "UHURA", NULL }; const char* ranger[] = { "ANTARES", "ARCHIMEDE", "BATMOBILE", "KIRK",
char hostname[256]; xvt_sys_get_host_name(hostname, sizeof(hostname)); "PICARD", "SPOCK", "SULU", "UHURA", NULL };
char hostname[80]; xvt_sys_get_host_name(hostname, sizeof(hostname));
for (int i = 0; ranger[i]; i++) for (int i = 0; ranger[i]; i++)
{ {
if (xvt_str_compare_ignoring_case(hostname, ranger[i]) == 0) if (xvt_str_compare_ignoring_case(hostname, ranger[i]) == 0)