From 6f664dd0a00f25c1bc664dccbd86d58018e94f5f Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 24 Mar 2003 16:21:20 +0000 Subject: [PATCH] Patch level : 2.0 434 Files correlati : le relapp Ricompilazione Demo : [ ] Commento : Probabilmente risolti i problemi sui listbox delle relapp. Continua la lenta ma inesorabile eliminazione delle chiamate a win32: oggi e' toccato alla finestra di scelta dei colori git-svn-id: svn://10.65.10.50/trunk@10944 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/checks.cpp | 2 +- include/colors.cpp | 3 +-- include/controls.cpp | 18 +++++++------ include/mask.cpp | 2 +- include/os_dep.h | 1 - include/os_win32.cpp | 60 -------------------------------------------- 6 files changed, 13 insertions(+), 73 deletions(-) diff --git a/include/checks.cpp b/include/checks.cpp index 8261565ae..73184915e 100755 --- a/include/checks.cpp +++ b/include/checks.cpp @@ -42,7 +42,7 @@ bool warning_box( // e l'icona punto di domanda. { buildmsg(); - xvt_dm_post_note(msg); + xvt_dm_post_warning(msg); return 0; } diff --git a/include/colors.cpp b/include/colors.cpp index 08fe75572..c86599a3e 100755 --- a/include/colors.cpp +++ b/include/colors.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -31,7 +30,7 @@ COLOR RGB2COLOR(unsigned char red, unsigned char green, unsigned char blue) COLOR choose_color(COLOR col, WINDOW win) { - return os_choose_color(col, win); + return xvt_dm_post_choose_color(win, col); } COLOR blend_colors(COLOR col1, COLOR col2, double perc) diff --git a/include/controls.cpp b/include/controls.cpp index bbaf6bb30..9bf7ca3b2 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -2157,10 +2157,11 @@ void TDropDownList::create() // Larghezza in pixel del bottone const int bw = int(_obj->itf->v.itf->fu_height * XI_FU_MULTIPLE / _obj->itf->v.itf->fu_width); len -= bw; -#ifdef XVAGA - len -= 4; // Don't ask me why -#endif - } + len -= 2; // Don't ask me why + } + else + len -= 6; // Don't ask me why + // Larghezza in form units dell'edit field len = len * XI_FU_MULTIPLE / _obj->itf->v.itf->fu_width - 2; @@ -2207,12 +2208,13 @@ void TDropDownList::create() itfdef->v.itf->win = (XinWindow)win; itfdef->v.itf->rctp = (XinRect *) ≀ XI_OBJ* itfobj = xi_create(NULL, itfdef); + CHECK(itfobj, "Can't create listbox"); + + xi_dequeue(); xi_tree_free(itfdef); - - CHECK(itfobj != NULL, "Oggetto del cazzo!"); - + _xi_lst = xi_get_obj(itfobj, _obj->cid+1000); - CHECK(_xi_lst != NULL, "Lista del cazzo!"); + CHECK(_xi_lst, "Can't create listbox"); } diff --git a/include/mask.cpp b/include/mask.cpp index 56b9b388a..a8d6b5a17 100755 --- a/include/mask.cpp +++ b/include/mask.cpp @@ -2044,7 +2044,7 @@ void TMask::make_profile_name(TFilename& f) const { f =::firm2dir(-1); // Directory dati f.add("config"); // Directory config - f.add(source_file()); // Nome Maschera + f.add(source_file().name()); // Nome Maschera f.ext("ini"); // Estensione } diff --git a/include/os_dep.h b/include/os_dep.h index 148826b2c..e01ceea7c 100755 --- a/include/os_dep.h +++ b/include/os_dep.h @@ -24,7 +24,6 @@ unsigned long os_get_disk_size(const char* path, char unit = 'b'); // units allo unsigned long os_get_disk_free_space(const char* path, char unit = 'b'); bool os_test_disk_free_space(const char* path, unsigned long filesize_bytes); -COLOR os_choose_color(COLOR col, WINDOW win); int os_execute(const TFilename& path, bool sync, bool iconizetask, bool showchild); unsigned long os_execute_in_window(const TFilename& path, WINDOW win); bool os_file_exist(const char* path); diff --git a/include/os_win32.cpp b/include/os_win32.cpp index e3463f3c6..06518d270 100755 --- a/include/os_win32.cpp +++ b/include/os_win32.cpp @@ -8,7 +8,6 @@ #include #include -#include #include #include #include @@ -72,70 +71,11 @@ bool os_allow_another_instance() return TRUE; } -COLOR os_choose_color(COLOR col, WINDOW win) -{ - CHOOSECOLOR cc; - memset(&cc, 0, sizeof(cc)); // Azzera struttura - - if (win == NULL_WIN) win = TASK_WIN; // Sceglie una finestra valida - - HWND hwnd = (HWND)xvt_vobj_get_attr(win, ATTR_NATIVE_WINDOW); - HDC hdc = GetDC(hwnd); - - // Legge la palette di sistema - PALETTEENTRY* pe = NULL; - int max_entries = 0; - if (GetDeviceCaps(hdc, RASTERCAPS) & RC_PALETTE) - { - max_entries = GetDeviceCaps(hdc, SIZEPALETTE); - pe = new PALETTEENTRY[max_entries]; - GetSystemPaletteEntries(hdc, 0, max_entries, pe); - } - ReleaseDC(hwnd, hdc); - - // Definisce i 16 colori customizzabili - unsigned long custom_colors[16]; - for (int c = 0; c < 16; c++) - { - if (pe) - { - const PALETTEENTRY& e = pe[c < 8 ? c : max_entries - 16 + c]; - custom_colors[c] = RGB(e.peRed, e.peGreen, e.peBlue); - } - else - { - const unsigned char val = (c & 0x8) ? 255 : 127; - const unsigned char red = (c & 0x1) ? val : 0; - const unsigned char green = (c & 0x2) ? val : 0; - const unsigned char blue = (c & 0x4) ? val : 0; - custom_colors[c] = RGB(red, green, blue); - } - } - if (pe) - { - delete pe; - pe = NULL; - } - - cc.lStructSize = sizeof(cc); // Setta dimensioni - cc.hwndOwner = hwnd; // Setta finestra padre - cc.rgbResult = RGB(XVT_COLOR_GET_RED(c), XVT_COLOR_GET_GREEN(c), XVT_COLOR_GET_BLUE(c)); - cc.lpCustColors = custom_colors; // Fissa colori custom - cc.Flags = CC_RGBINIT; // Usa col come primo colore - - if (ChooseColor(&cc) != 0) - col = RGB2COLOR(GetRValue(cc.rgbResult), GetGValue(cc.rgbResult), GetBValue(cc.rgbResult)); - else - col = COLOR_INVALID; - return col; -} - bool os_deny_another_instance() { return FALSE; } - bool os_destroy_native_icon(unsigned icon) { return DestroyIcon((HICON)icon) != 0;