From a1b9e5171da620ae8c942a1d1dcaaf01c203b8e1 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 24 Dec 2009 11:36:31 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : ba0 Ricompilazione Demo : [ ] Commento : Corretto nome server di chiavi in finestra about Aggiunto prompt color al tema Migliorata esportazione excel dei report Aggiunto supporto per disabilitazione nodi negli alberi git-svn-id: svn://10.65.10.50/trunk@19840 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/about.cpp | 6 +++--- include/colors.h | 1 + include/controls.cpp | 33 +++++++++++++++++---------------- include/execp.cpp | 6 +++--- include/reprint.cpp | 4 ++-- include/sheet.cpp | 2 +- include/treectrl.cpp | 18 +++++++++++++----- include/utility.cpp | 2 +- 8 files changed, 41 insertions(+), 31 deletions(-) diff --git a/include/about.cpp b/include/about.cpp index fb44bf742..a66d62e26 100755 --- a/include/about.cpp +++ b/include/about.cpp @@ -311,18 +311,18 @@ TInfo_mask::TInfo_mask() : TProperty_sheet(TR("Informazioni")) TConfig campoini(CONFIG_INSTALL, "Main"); TConfig userini(CONFIG_GUI, "Printer"); - + TString prot; const TDongleHardware dhw = dongle().hardware(); switch (dhw) { case _dongle_hardlock: prot = "Hardlock"; break; case _dongle_eutron : prot = "Eutron"; break; - case _dongle_network : prot = ini_get_string(CONFIG_INSTALL, "Main", "Dongle", "Server"); break; + case _dongle_network : prot = campoini.get("Dongle", "Server"); break; default : prot = TR("Nessuna"); break; } - const int type = campoini.get_int("Type"); + const int type = campoini.get_int("Type", "Main"); const char* tipo = NULL; switch (type) { diff --git a/include/colors.h b/include/colors.h index ea7e49231..7ba9c1320 100755 --- a/include/colors.h +++ b/include/colors.h @@ -21,6 +21,7 @@ extern COLOR BTN_DARK_COLOR; extern COLOR TOOL_BACK_COLOR; extern COLOR NORMAL_COLOR; extern COLOR NORMAL_BACK_COLOR; +extern COLOR PROMPT_COLOR; extern COLOR DISABLED_COLOR; extern COLOR DISABLED_BACK_COLOR; extern COLOR FOCUS_COLOR; diff --git a/include/controls.cpp b/include/controls.cpp index 9e8fcb844..2912bd806 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -29,6 +29,7 @@ COLOR BTN_DARK_COLOR = COLOR_GRAY; COLOR TOOL_BACK_COLOR = COLOR_GRAY; COLOR NORMAL_COLOR = COLOR_BLACK; COLOR NORMAL_BACK_COLOR = COLOR_WHITE; +COLOR PROMPT_COLOR = NORMAL_COLOR; COLOR DISABLED_COLOR = COLOR_DKGRAY; COLOR DISABLED_BACK_COLOR = MASK_BACK_COLOR; COLOR FOCUS_COLOR = NORMAL_COLOR; @@ -345,6 +346,7 @@ void customize_colors() MASK_DARK_COLOR = colors.get_color("MaskDark", NULL, -1, MASK_DARK_COLOR); NORMAL_COLOR = colors.get_color("Normal", NULL, -1, NORMAL_COLOR); NORMAL_BACK_COLOR = colors.get_color("NormalBack", NULL, -1, NORMAL_BACK_COLOR); + PROMPT_COLOR = colors.get_color("Prompt", NULL, -1, PROMPT_COLOR); REQUIRED_BACK_COLOR = colors.get_color("RequiredBack", NULL, -1, REQUIRED_BACK_COLOR); DISABLED_COLOR = colors.get_color("Disabled", NULL, -1, DISABLED_COLOR); DISABLED_BACK_COLOR = colors.get_color("DisabledBack", NULL, -1, DISABLED_BACK_COLOR); @@ -973,13 +975,13 @@ unsigned long TControl::flags2attr(const char* flags) const { switch(toupper(*f)) { - case '*': attrib |= XI_ATR_PASSWORD; break; - case 'C': attrib |= XI_ATR_HCENTER; break; - case 'D': attrib &= ~XI_ATR_ENABLED; break; - case 'H': attrib &= ~XI_ATR_VISIBLE; break; - case 'L': attrib |= XI_ATR_READONLY; break; - case 'R': attrib |= XI_ATR_RJUST; break; - default : break; + case '*': attrib |= XI_ATR_PASSWORD; break; + case 'C': attrib |= XI_ATR_HCENTER; break; + case 'D': attrib &= ~XI_ATR_ENABLED; break; + case 'H': attrib &= ~XI_ATR_VISIBLE; break; + case 'L': attrib |= XI_ATR_READONLY; break; + case 'R': attrib |= XI_ATR_RJUST; break; + default : break; } } return attrib; @@ -989,7 +991,7 @@ const char* TControl::parse_caption(const char* cap, bool& bold, bool& big, COLO { bold = false; big = false; - color = NORMAL_COLOR; + color = PROMPT_COLOR; const char* t; @@ -1747,16 +1749,16 @@ void TPushbutton_control::update() const long attrib = xi_get_attrib(_obj); if (attrib & XI_ATR_VISIBLE) { - WINDOW win = parent(); + XinWindow win = xi_get_window(_obj); XI_RCT rct; xi_get_rect(_obj, &rct); // = _obj->v.btn->rct; xi_inflate_rect(&rct, -3); - xi_set_clip((XinWindow)win, &rct); + xi_set_clip(win, &rct); // Cancello il testo sottostante CBRUSH brush = { PAT_SOLID, BTN_BACK_COLOR }; - xvt_dwin_set_cbrush(win, &brush); - xvt_dwin_set_std_cpen(win, TL_PEN_HOLLOW); - xi_draw_rect((XinWindow)win, &rct); + xvt_dwin_set_cbrush((WINDOW)win, &brush); + xvt_dwin_set_std_cpen((WINDOW)win, TL_PEN_HOLLOW); + xi_draw_rect(win, &rct); const int bmp = (_bmp_dn > 0 && _obj->v.btn->down) ? _bmp_dn : _bmp_up; if (bmp > 0) @@ -1765,9 +1767,9 @@ void TPushbutton_control::update() RCT& dst = xvtil_align_rect(i.rect(), (RCT&)rct, 'C', 'C', '-'); if (_obj->v.btn->down) xvt_rect_offset(&dst, 2, 2); - i.draw(win, dst); + i.draw((WINDOW)win, dst); } - xi_set_clip((XinWindow)win, NULL); + xi_set_clip(win, NULL); } } } @@ -1871,7 +1873,6 @@ TRadiobutton_control::TRadiobutton_control(WINDOW win, short cid, XI_OBJ_DEF* btn_def = xi_add_button_def(def, cid + b*1000, NULL, attrib, (char*)t, next); CHECKD(btn_def, "Can't create definition for radio-button ", cid); btn_def->app_data = (long)this; - XI_BTN_DEF* btn = btn_def->v.btn; btn->type = XIBT_RADIOBTN; btn->fore_color = color; diff --git a/include/execp.cpp b/include/execp.cpp index b7da025d9..0fc5a9628 100755 --- a/include/execp.cpp +++ b/include/execp.cpp @@ -8,11 +8,11 @@ static bool is_outlook_menu_chain() { - const TFixed_string app(__argv[0]); + const TFilename n = __argv[0]; + const TString& app = n.name_only(); if (app.match("*ba[0,1]*", true)) return false; - TConfig ini(CONFIG_GUI, "Colors"); - return ini.get_int("TreeView") == 3; + return ini_get_int(CONFIG_GUI, "Colors", "TreeView") == 3; } // @doc EXTERNAL diff --git a/include/reprint.cpp b/include/reprint.cpp index c47e8df07..126031cc5 100755 --- a/include/reprint.cpp +++ b/include/reprint.cpp @@ -1737,11 +1737,11 @@ bool TBook::export_excel(TFilename& fname, bool signature) col = x * cpi() / res.x; wid = w * cpi() / res.x; } else - if (str.starts_with("" && !ifs.eof()) diff --git a/include/sheet.cpp b/include/sheet.cpp index d4f1d34e9..32891044f 100755 --- a/include/sheet.cpp +++ b/include/sheet.cpp @@ -1510,7 +1510,7 @@ bool TCursor_sheet::in_key(const TFieldref& fr) const TCursor_sheet::TCursor_sheet(TCursor* cursor, const char* fields, const char* title, const char* head, byte buttons, short sht_y, WINDOW parent) - : TSheet(sht_y ? 2 : 0, sht_y ? 2 : 0, sht_y ? -2 : 0, sht_y ? -2 : 0, + : TSheet(sht_y ? 3 : 0, sht_y ? 3 : 0, sht_y ? -3 : 0, sht_y ? -3 : 0, title, head, buttons, sht_y, parent), _cursor(cursor) { TToken_string fldlst(fields); diff --git a/include/treectrl.cpp b/include/treectrl.cpp index 3faeb0d6d..7345358ca 100755 --- a/include/treectrl.cpp +++ b/include/treectrl.cpp @@ -279,11 +279,17 @@ bool TTree_window::add_child(XVT_TREEVIEW_NODE parent) ii = im_nor->xvt_image(); } XVT_TREEVIEW_NODE child = xvt_treeview_add_child_node(_ctrl, parent, type, ii, ic, ie, desc, NULL, id); - if (child != NULL && type == XVT_TREEVIEW_NODE_NONTERMINAL && _tree->expanded()) + if (child != NULL) { - for (bool ok = _tree->goto_firstson(); ok; ok = _tree->goto_rbrother()) - add_child(child); - xvt_treeview_expand_node(_ctrl, child, FALSE); + if (!_tree->enabled()) + xvt_treeview_enable_node(_ctrl, child, FALSE); + + if (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); @@ -394,6 +400,7 @@ void TTree_window::update() if (_header.full()) { clear(MASK_BACK_COLOR); + set_color(PROMPT_COLOR, MASK_BACK_COLOR); short x = 3, y = 0; FOR_EACH_TOKEN(_header, row) stringat(x, y++, row); @@ -541,6 +548,7 @@ TTree_window::TTree_window(int x, int y, int dx, int dy, WINDOW parent, TTree_fi xcc[2].type = XVT_COLOR_HIGHLIGHT; xcc[2].color = FOCUS_BACK_COLOR; xcc[3].type = XVT_COLOR_SELECT; xcc[3].color = FOCUS_COLOR; xcc[4].type = XVT_COLOR_BLEND; xcc[4].color = MASK_BACK_COLOR; + xcc[5].type = XVT_COLOR_TROUGH; xcc[5].color = DISABLED_COLOR; xvt_ctl_set_colors(_ctrl, xcc, XVT_COLOR_ACTION_SET); } @@ -642,7 +650,7 @@ TOutlook_window::TOutlook_window(int x, int y, int dx, int dy, WINDOW parent, TO { XVT_COLOR_COMPONENT xcc[4]; memset(xcc, 0, sizeof(xcc)); xcc[0].type = XVT_COLOR_BACKGROUND; xcc[0].color = BTN_BACK_COLOR; - xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = NORMAL_COLOR; + xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = PROMPT_COLOR; WIN_DEF wd; memset(&wd, 0, sizeof(wd)); wd.wtype = WC_OUTLOOKBAR; diff --git a/include/utility.cpp b/include/utility.cpp index 1e8fcca7d..bbeece603 100755 --- a/include/utility.cpp +++ b/include/utility.cpp @@ -595,7 +595,7 @@ bool is_power_station() { ps = FALSE; const TDongle& d = dongle(); - if (d.number() == 0 && d.hardware() != _dongle_network) + if (d.number() == 0) { const char* const ranger[] = { "ANTARES", "ARCHIMEDE", "BATMOBILE", "KIRK", "MOBILE", "PICARD", "SPOCK", "SULU", "UHURA", NULL };