From b35f372dfc8f16c93972d15d0e47a96f4a0f9403 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 14 Feb 2008 16:39:04 +0000 Subject: [PATCH] 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 --- include/treectrl.cpp | 23 +++++++++++------------ include/treectrl.h | 13 ++++++++++++- include/utility.cpp | 8 ++++---- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/include/treectrl.cpp b/include/treectrl.cpp index 93e75123b..39b3f853a 100755 --- a/include/treectrl.cpp +++ b/include/treectrl.cpp @@ -878,17 +878,6 @@ TTree_window::TTree_window(int x, int y, int dx, int dy, // 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) { switch (ep->type) @@ -901,6 +890,10 @@ void TControl_host_window::handler(WINDOW win, EVENT* ep) xvt_vobj_move(_ctrl, &rct); } break; + case E_UPDATE: + if (_ctrl != NULL_WIN) + return; // Inutile disegnare: _ctrl occupa tutta la client area + break; default: break; } @@ -968,8 +961,14 @@ bool TTree_window::add_child(XVT_TREEVIEW_NODE parent) else ii = im_nor->xvt_image(); 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); + } + + _tree->goto_node(id); return true; } diff --git a/include/treectrl.h b/include/treectrl.h index 1e5674a02..8b19486e6 100755 --- a/include/treectrl.h +++ b/include/treectrl.h @@ -5,6 +5,18 @@ #include "maskfld.h" #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 { TGolem_field* _driver; @@ -25,7 +37,6 @@ public: virtual ~TGolem_client_field(); }; - // Implemented in tree.cpp class TTree; diff --git a/include/utility.cpp b/include/utility.cpp index cd2621845..b2b552dce 100755 --- a/include/utility.cpp +++ b/include/utility.cpp @@ -590,17 +590,17 @@ long daytime() if (time(<) != -1) { struct tm * timeloc = localtime(<); - 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; } bool is_power_station() { - const char* ranger[] = { "ANTARES", "ARCHIMEDE", "BATMOBILE", "KIRK", "SPOCK", "UHURA", NULL }; - char hostname[256]; xvt_sys_get_host_name(hostname, sizeof(hostname)); + const char* ranger[] = { "ANTARES", "ARCHIMEDE", "BATMOBILE", "KIRK", + "PICARD", "SPOCK", "SULU", "UHURA", NULL }; + char hostname[80]; xvt_sys_get_host_name(hostname, sizeof(hostname)); for (int i = 0; ranger[i]; i++) { if (xvt_str_compare_ignoring_case(hostname, ranger[i]) == 0)