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
This commit is contained in:
parent
5e6a6d1d21
commit
6f664dd0a0
@ -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;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include <os_dep.h>
|
||||
#include <colmask.h>
|
||||
#include <colors.h>
|
||||
#include <config.h>
|
||||
@ -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)
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#include <applicat.h>
|
||||
#include <colors.h>
|
||||
#include <config.h>
|
||||
#include <utility.h>
|
||||
#include <window.h>
|
||||
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user