Patch level : 10.0
Files correlati : tutti Ricompilazione Demo : [ ] Commento : Migliorata gestione colori dei controlli git-svn-id: svn://10.65.10.50/trunk@17590 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f6c12db548
commit
93c9ce1cad
@ -479,12 +479,8 @@ int DB_lockfile(int handle)
|
|||||||
HIDDEN void do_key(const char *fname, RecDes *r, TAG4INFO *tag_info, int n_keys)
|
HIDDEN void do_key(const char *fname, RecDes *r, TAG4INFO *tag_info, int n_keys)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
char tiname[_MAX_FNAME]; /* Tag name, max 8 characters long! */
|
char tiname[_MAX_FNAME]; /* Tag name */
|
||||||
char* dot;
|
_splitpath(fname, NULL, NULL, tiname, NULL);
|
||||||
|
|
||||||
strcpy(tiname,fname);
|
|
||||||
dot = strchr(tiname, '.');
|
|
||||||
if (dot) *dot = '\0';
|
|
||||||
xvt_str_make_upper(tiname);
|
xvt_str_make_upper(tiname);
|
||||||
for (i=0; ((i < MaxKeys) && (i < n_keys)); i++)
|
for (i=0; ((i < MaxKeys) && (i < n_keys)); i++)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#include <colmask.h>
|
#include <colmask.h>
|
||||||
#include <colors.h>
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <diction.h>
|
#include <diction.h>
|
||||||
|
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
#ifndef __COLORS_H
|
#ifndef __COLORS_H
|
||||||
#define __COLORS_H
|
#define __COLORS_H
|
||||||
|
|
||||||
#ifndef __STDTYPES_H
|
|
||||||
#include <stdtypes.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef XVT_INCL_XVT
|
#ifndef XVT_INCL_XVT
|
||||||
#include <xvt.h>
|
#include <xvt.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -83,6 +83,12 @@ XVT_IMAGE TImage::load(short id)
|
|||||||
return set(xvt_res_get_image(id));
|
return set(xvt_res_get_image(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Certified 100%
|
||||||
|
XVT_IMAGE TImage::load_icon(short id)
|
||||||
|
{
|
||||||
|
return set(xvt_res_get_icon(id));
|
||||||
|
}
|
||||||
|
|
||||||
// Certified 100%
|
// Certified 100%
|
||||||
TImage::TImage(const char* n) : _image(NULL)
|
TImage::TImage(const char* n) : _image(NULL)
|
||||||
{
|
{
|
||||||
@ -91,9 +97,15 @@ TImage::TImage(const char* n) : _image(NULL)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Certified 100%
|
// Certified 100%
|
||||||
TImage::TImage(short id) : _image(NULL)
|
TImage::TImage(short id, bool is_icon) : _image(NULL)
|
||||||
{
|
{
|
||||||
if (id > 0) load(id);
|
if (id > 0)
|
||||||
|
{
|
||||||
|
if (is_icon)
|
||||||
|
load_icon(id);
|
||||||
|
else
|
||||||
|
load(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certified 90%
|
// Certified 90%
|
||||||
@ -259,12 +271,26 @@ void TImage::convert_transparent_color(COLOR transparent)
|
|||||||
|
|
||||||
if (xvt_image_get_format(_image) == XVT_IMAGE_CL8)
|
if (xvt_image_get_format(_image) == XVT_IMAGE_CL8)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
for (int index = xvt_image_get_ncolors(_image)-1; index >=0; index--)
|
for (int index = xvt_image_get_ncolors(_image)-1; index >=0; index--)
|
||||||
if (same_color(trans, xvt_image_get_clut(_image, index)))
|
if (same_color(trans, xvt_image_get_clut(_image, index)))
|
||||||
{
|
{
|
||||||
xvt_image_set_clut(_image, index, transparent);
|
xvt_image_set_clut(_image, index, transparent);
|
||||||
// break; don't break: replace all colors equal to upper left in the palette
|
// break; don't break: replace all colors equal to upper left in the palette
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
int i = -1;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
const int index = xvt_image_find_clut_index(_image, trans);
|
||||||
|
if (index > i)
|
||||||
|
{
|
||||||
|
xvt_image_set_clut(_image, index, transparent);
|
||||||
|
i = index;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -59,6 +59,8 @@ public:
|
|||||||
XVT_IMAGE load(const char* n);
|
XVT_IMAGE load(const char* n);
|
||||||
// @cmember Legge l'immagine dal file di risorse
|
// @cmember Legge l'immagine dal file di risorse
|
||||||
XVT_IMAGE load(short id);
|
XVT_IMAGE load(short id);
|
||||||
|
// @cmember Legge l'immagine dal file di risorse
|
||||||
|
XVT_IMAGE load_icon(short id);
|
||||||
|
|
||||||
// @cmember Controlla che l'immagine sia un oggetto valido (diverso da NULL)
|
// @cmember Controlla che l'immagine sia un oggetto valido (diverso da NULL)
|
||||||
virtual bool ok() const
|
virtual bool ok() const
|
||||||
@ -96,7 +98,7 @@ public:
|
|||||||
// @cmember Costruttore. Viene passato il nome del file
|
// @cmember Costruttore. Viene passato il nome del file
|
||||||
TImage(const char* n);
|
TImage(const char* n);
|
||||||
// @cmember Costruttore. Viene passato l'identificatore dell'immagine sul file di risorsa
|
// @cmember Costruttore. Viene passato l'identificatore dell'immagine sul file di risorsa
|
||||||
TImage(short id);
|
TImage(short id, bool is_icon = false);
|
||||||
// @cmember Costruttore. Viene passata l'immagine e le sue diemsioni
|
// @cmember Costruttore. Viene passata l'immagine e le sue diemsioni
|
||||||
TImage(const TImage& i, short width = -1, short height = -1);
|
TImage(const TImage& i, short width = -1, short height = -1);
|
||||||
// @cmember Costruttore. Viene passata l'immagine e le sue diemsioni
|
// @cmember Costruttore. Viene passata l'immagine e le sue diemsioni
|
||||||
|
@ -276,9 +276,6 @@ TMask::TMask(const char* maskname, int num, int max)
|
|||||||
TMask::~TMask()
|
TMask::~TMask()
|
||||||
{
|
{
|
||||||
_field.destroy();
|
_field.destroy();
|
||||||
|
|
||||||
//xvt_vobj_destroy(_toolwin);
|
|
||||||
//xvt_vobj_destroy(_notebook);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
word TMask::class_id() const
|
word TMask::class_id() const
|
||||||
@ -1225,8 +1222,13 @@ WINDOW TMask::create_book(bool single)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
CHECK(_notebook == NULL_WIN, "One single notebook, please!");
|
CHECK(_notebook == NULL_WIN, "One single notebook, please!");
|
||||||
|
XVT_COLOR_COMPONENT xcc[4]; memset(xcc, 0, sizeof(xcc));
|
||||||
|
xcc[0].type = XVT_COLOR_BACKGROUND; xcc[0].color = MASK_BACK_COLOR;
|
||||||
|
xcc[1].type = XVT_COLOR_FOREGROUND; xcc[1].color = NORMAL_COLOR;
|
||||||
|
|
||||||
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
|
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
|
||||||
wd.wtype = WC_NOTEBK;
|
wd.wtype = WC_NOTEBK;
|
||||||
|
wd.ctlcolors = xcc;
|
||||||
wd.v.ctl.flags = CTL_FLAG_TAB_DEFAULT | CTL_FLAG_TAB_TOP;
|
wd.v.ctl.flags = CTL_FLAG_TAB_DEFAULT | CTL_FLAG_TAB_TOP;
|
||||||
xvt_vobj_get_client_rect(parent, &wd.rct);
|
xvt_vobj_get_client_rect(parent, &wd.rct);
|
||||||
_notebook = xvt_ctl_create_def(&wd, parent, long(this));
|
_notebook = xvt_ctl_create_def(&wd, parent, long(this));
|
||||||
@ -1293,7 +1295,7 @@ WINDOW TMask::create_bar(int height)
|
|||||||
const long flags = TOOL_TEXT ? CTL_FLAG_PASSWORD : 0;
|
const long flags = TOOL_TEXT ? CTL_FLAG_PASSWORD : 0;
|
||||||
w = xvt_toolbar_create(-1, 0, 0, -1, TOOL_SIZE, flags, win()); // Top bar
|
w = xvt_toolbar_create(-1, 0, 0, -1, TOOL_SIZE, flags, win()); // Top bar
|
||||||
XVT_COLOR_COMPONENT cc[4]; memset(cc, 0, sizeof(cc));
|
XVT_COLOR_COMPONENT cc[4]; memset(cc, 0, sizeof(cc));
|
||||||
cc[0].type = XVT_COLOR_TROUGH; cc[0].color = MASK_BACK_COLOR;
|
cc[0].type = XVT_COLOR_BLEND; cc[0].color = MASK_BACK_COLOR;
|
||||||
cc[1].type = XVT_COLOR_FOREGROUND; cc[1].color = NORMAL_COLOR;
|
cc[1].type = XVT_COLOR_FOREGROUND; cc[1].color = NORMAL_COLOR;
|
||||||
xvt_ctl_set_colors(w, cc, XVT_COLOR_ACTION_SET);
|
xvt_ctl_set_colors(w, cc, XVT_COLOR_ACTION_SET);
|
||||||
}
|
}
|
||||||
|
@ -2672,6 +2672,9 @@ KEY TBrowse::run()
|
|||||||
|
|
||||||
switch (k)
|
switch (k)
|
||||||
{
|
{
|
||||||
|
case K_ESC:
|
||||||
|
case K_QUIT:
|
||||||
|
break;
|
||||||
case K_CTRL+'G':
|
case K_CTRL+'G':
|
||||||
*_cursor = selected;
|
*_cursor = selected;
|
||||||
k = do_link(FALSE) ? K_ENTER : K_ESC;
|
k = do_link(FALSE) ? K_ENTER : K_ESC;
|
||||||
@ -2693,7 +2696,7 @@ KEY TBrowse::run()
|
|||||||
f.set_dirty(vals.get_int());
|
f.set_dirty(vals.get_int());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (k >= K_CTRL)
|
if (k >= K_CTRL) // Scatta la ricerca su di una chiave alternativa
|
||||||
{
|
{
|
||||||
TMask& m = field().mask();
|
TMask& m = field().mask();
|
||||||
const int tag = k - K_CTRL - K_F1;
|
const int tag = k - K_CTRL - K_F1;
|
||||||
@ -2798,16 +2801,14 @@ void TFile_select::parse_output(TScanner& scanner)
|
|||||||
|
|
||||||
KEY TFile_select::run()
|
KEY TFile_select::run()
|
||||||
{
|
{
|
||||||
DIRECTORY savedir;
|
TFilename path;
|
||||||
|
path.add(field().get());
|
||||||
|
path.ext(_filter.ext());
|
||||||
|
|
||||||
FILE_SPEC fs;
|
FILE_SPEC fs;
|
||||||
|
xvt_fsys_convert_str_to_fspec(path, &fs);
|
||||||
|
|
||||||
xvt_fsys_get_dir(&savedir);
|
DIRECTORY savedir; xvt_fsys_get_dir(&savedir);
|
||||||
xvt_fsys_get_dir(&fs.dir);
|
|
||||||
|
|
||||||
strcpy(fs.type, _filter.ext());
|
|
||||||
strcpy(fs.name, field().get());
|
|
||||||
strcpy(fs.creator, "AGA");
|
|
||||||
|
|
||||||
bool good = xvt_dm_post_file_open(&fs, field().prompt()) == FL_OK;
|
bool good = xvt_dm_post_file_open(&fs, field().prompt()) == FL_OK;
|
||||||
xvt_fsys_set_dir(&savedir);
|
xvt_fsys_set_dir(&savedir);
|
||||||
|
|
||||||
@ -2816,13 +2817,12 @@ KEY TFile_select::run()
|
|||||||
good = _filter.blank() || xvt_str_match(fs.name, _filter, false);
|
good = _filter.blank() || xvt_str_match(fs.name, _filter, false);
|
||||||
if (good)
|
if (good)
|
||||||
{
|
{
|
||||||
TFilename path;
|
|
||||||
xvt_fsys_convert_dir_to_str(&fs.dir, path.get_buffer(), path.size());
|
xvt_fsys_convert_dir_to_str(&fs.dir, path.get_buffer(), path.size());
|
||||||
path.add(fs.name);
|
path.add(fs.name);
|
||||||
field().set(path);
|
field().set(path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
field().error_box(TR("Il nome non corrisponde a %s"), _filter.get_buffer());
|
field().error_box(FR("Il nome non corrisponde a %s"), _filter.get_buffer());
|
||||||
}
|
}
|
||||||
return good ? K_ENTER : K_ESC;
|
return good ? K_ENTER : K_ESC;
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,6 @@ extern "C"
|
|||||||
#include <relation.h>
|
#include <relation.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
class TCell_property : public TObject
|
class TCell_property : public TObject
|
||||||
{
|
{
|
||||||
COLOR _back, _fore;
|
COLOR _back, _fore;
|
||||||
@ -1117,7 +1115,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
{
|
{
|
||||||
const real r(src); // Memorizzo valore numerico
|
const real r(src); // Memorizzo valore numerico
|
||||||
const int pos = driver->dlg() - FIRST_FIELD;
|
const int pos = driver->dlg() - FIRST_FIELD;
|
||||||
const TString16 codval = rowrec.get(pos); // Codice valuta
|
const TString4 codval = rowrec.get(pos); // Codice valuta
|
||||||
const TCurrency c(r, codval, ZERO, _exchange_undefined, e->uppercase());
|
const TCurrency c(r, codval, ZERO, _exchange_undefined, e->uppercase());
|
||||||
src = c.string(TRUE);
|
src = c.string(TRUE);
|
||||||
break;
|
break;
|
||||||
@ -1131,7 +1129,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (e->class_id() == CLASS_BOOLEAN_FIELD) //qui
|
if (e->class_id() == CLASS_BOOLEAN_FIELD)
|
||||||
xiev->v.cell_request.icon_rid = ICO_CHECK_OFF;
|
xiev->v.cell_request.icon_rid = ICO_CHECK_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1146,13 +1144,14 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev)
|
|||||||
xiev->v.cell_request.color, rec, col);
|
xiev->v.cell_request.color, rec, col);
|
||||||
if (xiev->v.cell_request.back_color == 0 && f->required())
|
if (xiev->v.cell_request.back_color == 0 && f->required())
|
||||||
xiev->v.cell_request.back_color = REQUIRED_BACK_COLOR;
|
xiev->v.cell_request.back_color = REQUIRED_BACK_COLOR;
|
||||||
}
|
|
||||||
|
|
||||||
|
if (e->has_query_button()) // Metto il bottone sulle celle attive
|
||||||
if (e->has_query_button())
|
|
||||||
{
|
{
|
||||||
xiev->v.cell_request.button = TRUE;
|
xiev->v.cell_request.button = TRUE;
|
||||||
xiev->v.cell_request.button_on_focus = TRUE;
|
xiev->v.cell_request.button_on_focus = TRUE;
|
||||||
|
if (e->has_check())
|
||||||
|
xiev->v.cell_request.button_icon_rid = ICO_SEARCH;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1102,8 +1102,10 @@ void TSheet::repos_buttons() const
|
|||||||
return; // Sono ancora in fase di creazione: aspetta!
|
return; // Sono ancora in fase di creazione: aspetta!
|
||||||
|
|
||||||
WINDOW btnwin = toolwin(); // was win()
|
WINDOW btnwin = toolwin(); // was win()
|
||||||
RCT br, wr;
|
if (btnwin != NULL_WIN)
|
||||||
|
{
|
||||||
int buttons = 0;
|
int buttons = 0;
|
||||||
|
RCT br;
|
||||||
FOR_EACH_MASK_FIELD((*this), f, c)
|
FOR_EACH_MASK_FIELD((*this), f, c)
|
||||||
{
|
{
|
||||||
if (c->parent() == btnwin && c->is_kind_of(CLASS_BUTTON_FIELD))
|
if (c->parent() == btnwin && c->is_kind_of(CLASS_BUTTON_FIELD))
|
||||||
@ -1113,10 +1115,9 @@ void TSheet::repos_buttons() const
|
|||||||
buttons++;
|
buttons++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buttons > 0)
|
if (buttons > 0)
|
||||||
{
|
{
|
||||||
xvt_vobj_get_client_rect(btnwin, &wr);
|
RCT wr; xvt_vobj_get_client_rect(btnwin, &wr);
|
||||||
const short width = br.right - br.left;
|
const short width = br.right - br.left;
|
||||||
const short height = br.bottom - br.top;
|
const short height = br.bottom - br.top;
|
||||||
|
|
||||||
@ -1137,11 +1138,12 @@ void TSheet::repos_buttons() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Aggiusta anche lo spreadsheet se necessario
|
// Aggiusta anche lo spreadsheet se necessario
|
||||||
TMask_field& s = field(DLG_QUERY);
|
TMask_field& s = field(DLG_QUERY);
|
||||||
xvt_vobj_get_client_rect(s.parent(), &wr);
|
RCT wr; xvt_vobj_get_client_rect(s.parent(), &wr);
|
||||||
s.get_rect(br);
|
RCT br; s.get_rect(br);
|
||||||
if (br.bottom > wr.bottom || (wr.bottom-br.bottom) > 48)
|
if (br.bottom > wr.bottom || (wr.bottom-br.bottom) > 48)
|
||||||
{
|
{
|
||||||
br.bottom = wr.bottom - br.left; // Lascio uno spazio in fondo pari al bordo sinistro
|
br.bottom = wr.bottom - br.left; // Lascio uno spazio in fondo pari al bordo sinistro
|
||||||
@ -1707,24 +1709,19 @@ void TBrowse_sheet::handler(
|
|||||||
switch (ep->v.mouse.button )
|
switch (ep->v.mouse.button )
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
{
|
||||||
|
RCT r; sheet().get_rect(r);
|
||||||
|
if (xvt_rect_has_point(&r, ep->v.mouse.where))
|
||||||
{
|
{
|
||||||
MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR);
|
MENU_ITEM* menu = xvt_res_get_menu(BROWSE_BAR);
|
||||||
if (menu)
|
if (menu)
|
||||||
{
|
{
|
||||||
dictionary_translate_menu(menu);
|
dictionary_translate_menu(menu);
|
||||||
const PNT& p = ep->v.mouse.where;
|
xvt_menu_popup(menu->child, win, ep->v.mouse.where, XVT_POPUP_LEFT_ALIGN, NULL);
|
||||||
RCT cr; xvt_vobj_get_client_rect(win, &cr);
|
|
||||||
XVT_POPUP_ALIGNMENT pa = XVT_POPUP_CENTER;
|
|
||||||
if (p.h < cr.right / 3)
|
|
||||||
pa = XVT_POPUP_LEFT_ALIGN;
|
|
||||||
else
|
|
||||||
if (p.h > 2 * cr.right / 3)
|
|
||||||
pa = XVT_POPUP_RIGHT_ALIGN;
|
|
||||||
|
|
||||||
xvt_menu_popup(menu->child, win, p, pa, NULL);
|
|
||||||
xvt_res_free_menu_tree(menu);
|
xvt_res_free_menu_tree(menu);
|
||||||
|
return; // no default handling!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -1758,6 +1755,7 @@ void TBrowse_sheet::handler(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#if OLD_FASHIONED_BROWSE
|
||||||
case E_CONTROL:
|
case E_CONTROL:
|
||||||
if (ep->v.ctl.ci.type == WC_NOTEBK)
|
if (ep->v.ctl.ci.type == WC_NOTEBK)
|
||||||
{
|
{
|
||||||
@ -1766,6 +1764,7 @@ void TBrowse_sheet::handler(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1865,7 +1864,7 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
|
|||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
for (const char* i = ids.get(0); i; i = ids.get())
|
FOR_EACH_TOKEN(ids, i)
|
||||||
{
|
{
|
||||||
if (*i != '\0' && *i != '"' && strchr(i, '@') == NULL)
|
if (*i != '\0' && *i != '"' && strchr(i, '@') == NULL)
|
||||||
{
|
{
|
||||||
@ -1914,14 +1913,14 @@ TBrowse_sheet::TBrowse_sheet(TCursor* cursor, const char* fields,
|
|||||||
const int sz = csize > 50 ? 50 : csize; // Dimensione del campo di ricerca
|
const int sz = csize > 50 ? 50 : csize; // Dimensione del campo di ricerca
|
||||||
e = &add_string(c.dlg(), 0, p, 1, y++, csize, flags, sz);
|
e = &add_string(c.dlg(), 0, p, 1, y++, csize, flags, sz);
|
||||||
// Aggiunge campo con le icone di filtraggio
|
// Aggiunge campo con le icone di filtraggio
|
||||||
add_checkbutton(c.dlg()+500, 0, "", sz+strlen(p)+ 2, y-1, 2, 1, "", 10112, 10113).set_handler(filter_handler);
|
add_checkbutton(c.dlg()+500, 0, "", sz+p.len()+ 2, y-1, 2, 1, "", 10112, 10113).set_handler(filter_handler);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CLASS_ZOOM_FIELD:
|
case CLASS_ZOOM_FIELD:
|
||||||
{
|
{
|
||||||
e = &add_string(c.dlg(), 0, p, 1, y++, 32000, flags, 50);
|
e = &add_string(c.dlg(), 0, p, 1, y++, 32000, flags, 50);
|
||||||
// Aggiunge campo con le icone di filtraggio
|
// Aggiunge campo con le icone di filtraggio
|
||||||
add_checkbutton(c.dlg()+500, 0, "", 52 + strlen(p), y-1, 2, 1, "", 10112, 10113).set_handler(filter_handler);
|
add_checkbutton(c.dlg()+500, 0, "", 52 + p.len(), y-1, 2, 1, "", 10112, 10113).set_handler(filter_handler);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CLASS_REAL_FIELD:
|
case CLASS_REAL_FIELD:
|
||||||
|
@ -66,7 +66,7 @@ TString& TString::set(
|
|||||||
{
|
{
|
||||||
const int sz = strlen(s);
|
const int sz = strlen(s);
|
||||||
if (sz > size()) resize(sz, false);
|
if (sz > size()) resize(sz, false);
|
||||||
strcpy(_str, s);
|
strncpy(s, size());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -123,7 +123,13 @@ TString::TString() : _str(NULL), _size(0)
|
|||||||
TString::~TString()
|
TString::~TString()
|
||||||
{
|
{
|
||||||
if (_str)
|
if (_str)
|
||||||
|
{
|
||||||
delete _str;
|
delete _str;
|
||||||
|
#ifdef DBG
|
||||||
|
_str = NULL;
|
||||||
|
_size = -883;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char TString::shift(int n)
|
char TString::shift(int n)
|
||||||
@ -1086,14 +1092,25 @@ TString& TFixed_string::format(
|
|||||||
// Certified 90%
|
// Certified 90%
|
||||||
const char* TFilename::ext() const
|
const char* TFilename::ext() const
|
||||||
{
|
{
|
||||||
|
/* Riduciamo il parsing "manuale" dei nomi dei file
|
||||||
const char* d = strrchr(name(), '.');
|
const char* d = strrchr(name(), '.');
|
||||||
if (d && is_not_slash(*(++d))) return d;
|
if (d && is_not_slash(*(++d)))
|
||||||
|
return d;
|
||||||
|
return "";
|
||||||
|
*/
|
||||||
|
if (rfind('.') > 0)
|
||||||
|
{
|
||||||
|
char e[_MAX_EXT];
|
||||||
|
xvt_fsys_parse_pathname(_str, NULL, NULL, NULL, e, NULL);
|
||||||
|
return get_tmp_string() = e;
|
||||||
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certified 90%
|
// Certified 90%
|
||||||
void TFilename::ext(const char* e)
|
void TFilename::ext(const char* e)
|
||||||
{
|
{
|
||||||
|
/* Riduciamo il parsing "manuale" dei nomi dei file
|
||||||
int start = find(' ')-1;
|
int start = find(' ')-1;
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
start = len()-1;
|
start = len()-1;
|
||||||
@ -1116,12 +1133,16 @@ void TFilename::ext(const char* e)
|
|||||||
*this << ".";
|
*this << ".";
|
||||||
*this << e;
|
*this << e;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
char v[_MAX_DRIVE], d[_MAX_DIR], n[_MAX_FNAME];
|
||||||
|
xvt_fsys_parse_pathname(_str, v, d, n, NULL, NULL);
|
||||||
|
xvt_fsys_build_pathname(_str, v, d, n, e, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Certified 95%
|
// Certified 95%
|
||||||
const char* TFilename::name() const
|
const char* TFilename::name() const
|
||||||
{
|
{
|
||||||
|
/* Riduciamo il parsing "manuale" dei nomi dei file
|
||||||
int start = find(' ')-1;
|
int start = find(' ')-1;
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
start = len()-1;
|
start = len()-1;
|
||||||
@ -1134,11 +1155,36 @@ const char* TFilename::name() const
|
|||||||
spark = &_str[i+1];
|
spark = &_str[i+1];
|
||||||
spark.cut(start-i);
|
spark.cut(start-i);
|
||||||
return spark;
|
return spark;
|
||||||
|
*/
|
||||||
|
if (full())
|
||||||
|
{
|
||||||
|
char n[_MAX_FNAME], e[_MAX_EXT];
|
||||||
|
xvt_fsys_parse_pathname(_str, NULL, NULL, n, e, NULL);
|
||||||
|
TString& spark = get_tmp_string();
|
||||||
|
spark = n;
|
||||||
|
if (*e)
|
||||||
|
spark << '.' << e;
|
||||||
|
return spark;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Certified 95%
|
||||||
|
const TString& TFilename::name_only() const
|
||||||
|
{
|
||||||
|
if (full())
|
||||||
|
{
|
||||||
|
char n[_MAX_FNAME];
|
||||||
|
xvt_fsys_parse_pathname(_str, NULL, NULL, n, NULL, NULL);
|
||||||
|
return get_tmp_string() = n;
|
||||||
|
}
|
||||||
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certified 95%
|
// Certified 95%
|
||||||
const char* TFilename::path() const
|
const char* TFilename::path() const
|
||||||
{
|
{
|
||||||
|
/* Riduciamo il parsing "manuale" dei nomi dei file
|
||||||
int start = find(' ')-1;
|
int start = find(' ')-1;
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
start = len()-1;
|
start = len()-1;
|
||||||
@ -1150,9 +1196,20 @@ const char* TFilename::path() const
|
|||||||
spark = _str;
|
spark = _str;
|
||||||
spark.cut(i+1);
|
spark.cut(i+1);
|
||||||
return spark;
|
return spark;
|
||||||
|
*/
|
||||||
|
if (full())
|
||||||
|
{
|
||||||
|
char v[_MAX_DRIVE], d[_MAX_DIR];
|
||||||
|
xvt_fsys_parse_pathname(_str, v, d, NULL, NULL, NULL);
|
||||||
|
TString& spark = get_tmp_string();
|
||||||
|
spark << v << d;
|
||||||
|
if (spark.not_empty())
|
||||||
|
spark << SLASH;
|
||||||
|
return spark;
|
||||||
|
}
|
||||||
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TFilename& TFilename::add(const char* n)
|
TFilename& TFilename::add(const char* n)
|
||||||
{
|
{
|
||||||
if (not_empty() && is_not_slash(_str[len()-1]) && is_not_slash(*n))
|
if (not_empty() && is_not_slash(_str[len()-1]) && is_not_slash(*n))
|
||||||
@ -1161,7 +1218,6 @@ TFilename& TFilename::add(const char* n)
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
|
||||||
// @mfunc Controlla il formato del nome del file
|
// @mfunc Controlla il formato del nome del file
|
||||||
@ -1383,7 +1439,7 @@ bool TFilename::exist() const
|
|||||||
|
|
||||||
bool TFilename::fremove() const
|
bool TFilename::fremove() const
|
||||||
{
|
{
|
||||||
return ::remove_file(_str);
|
return xvt_fsys_remove_file(_str) != FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TFilename::search_in_path(TFilename& path) const
|
bool TFilename::search_in_path(TFilename& path) const
|
||||||
@ -1403,8 +1459,8 @@ bool TFilename::custom_path(const char* path_list)
|
|||||||
{
|
{
|
||||||
if (blank()) // Inutile continuare!
|
if (blank()) // Inutile continuare!
|
||||||
return false;
|
return false;
|
||||||
|
// Espando solo i nomi di file senza path (relativo o assoluto)
|
||||||
if (!is_absolute_path())
|
if (!starts_with(".") && !is_absolute_path())
|
||||||
{
|
{
|
||||||
TToken_string pl = path_list;
|
TToken_string pl = path_list;
|
||||||
if (pl.empty())
|
if (pl.empty())
|
||||||
@ -2039,7 +2095,7 @@ TToken_string& get_tmp_string(int len)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (str->size() < len)
|
if (str->size() < len)
|
||||||
str->spaces(len);
|
str->resize(len, false);
|
||||||
str->cut(0);
|
str->cut(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,18 +461,18 @@ class TFilename : public TString
|
|||||||
// @author:(INTERNAL) Guido
|
// @author:(INTERNAL) Guido
|
||||||
|
|
||||||
{
|
{
|
||||||
// @comm Nel caso di utilizzo di Windows 95 occorre cambiare le classe base in <c TString256>
|
|
||||||
|
|
||||||
// @access Public Member
|
// @access Public Member
|
||||||
public:
|
public:
|
||||||
// @cmember Costruttore
|
// @cmember Costruttore
|
||||||
TFilename(const char* n = "") : TString(256)
|
TFilename(const char* n = "") : TString(260)
|
||||||
{ set(n); }
|
{ set(n); }
|
||||||
// @cmember Costruttore
|
// @cmember Costruttore
|
||||||
TFilename(const TString& n) : TString(256)
|
TFilename(const TString& n) : TString(260)
|
||||||
{ set(n); }
|
{ set(n); }
|
||||||
// @cmember Costruttore
|
// @cmember Costruttore
|
||||||
TFilename(const TFilename& n) : TString(256)
|
TFilename(const TFilename& n) : TString(260)
|
||||||
{ set(n); }
|
{ set(n); }
|
||||||
|
|
||||||
// @cmember Assegnazione tra TFilename e stringa
|
// @cmember Assegnazione tra TFilename e stringa
|
||||||
@ -510,9 +510,11 @@ public:
|
|||||||
bool search_in_path(TFilename& path) const;
|
bool search_in_path(TFilename& path) const;
|
||||||
// @cmember Richiede all'utente il nome di un file
|
// @cmember Richiede all'utente il nome di un file
|
||||||
bool input();
|
bool input();
|
||||||
// @cmember Ritorna il nome del file
|
// @cmember Ritorna il nome del file con estensione
|
||||||
const char* name() const;
|
const char* name() const;
|
||||||
// @cmember Ritorna il nome del direttorio
|
// @cmember Ritorna il nome del file senza estensione
|
||||||
|
const TString& name_only() const;
|
||||||
|
// @cmember Ritorna il nome della cartella del file
|
||||||
const char* path() const;
|
const char* path() const;
|
||||||
// @cmember Genera il nome di un file temporaneo
|
// @cmember Genera il nome di un file temporaneo
|
||||||
const TFilename& temp(const char* prefix = NULL, const char* extension = NULL);
|
const TFilename& temp(const char* prefix = NULL, const char* extension = NULL);
|
||||||
|
@ -297,6 +297,30 @@ TImage* TTree::get_res_image(short bmp_id) const
|
|||||||
return bmp;
|
return bmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TImage* TTree::get_res_icon(short icon_id) const
|
||||||
|
{
|
||||||
|
const int id = 100000 + icon_id;
|
||||||
|
TImage* bmp = (TImage*)_image.objptr(id);
|
||||||
|
if (bmp == NULL)
|
||||||
|
{
|
||||||
|
TImage ico(icon_id, true);
|
||||||
|
if (ico.ok())
|
||||||
|
{
|
||||||
|
const TImage* def = get_res_image(BMP_FILE);
|
||||||
|
int w = 16, h = 16;
|
||||||
|
if (def != NULL)
|
||||||
|
{
|
||||||
|
w = def->width();
|
||||||
|
h = def->height();
|
||||||
|
}
|
||||||
|
ico.convert_transparent_color(NORMAL_BACK_COLOR);
|
||||||
|
bmp = new TImage(ico, w, h);
|
||||||
|
((TTree*)this)->_image.add(bmp, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bmp;
|
||||||
|
}
|
||||||
|
|
||||||
TImage* TTree::image(bool selected) const
|
TImage* TTree::image(bool selected) const
|
||||||
{
|
{
|
||||||
short bmp_id = BMP_FILE;
|
short bmp_id = BMP_FILE;
|
||||||
@ -305,7 +329,6 @@ TImage* TTree::image(bool selected) const
|
|||||||
return get_res_image(bmp_id);
|
return get_res_image(bmp_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// TBidirectional_tree
|
// TBidirectional_tree
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
@ -23,8 +23,9 @@ class TTree : public TObject
|
|||||||
protected:
|
protected:
|
||||||
TAssoc_array _expanded;
|
TAssoc_array _expanded;
|
||||||
TArray _image;
|
TArray _image;
|
||||||
|
// helpers for image(bool)
|
||||||
TImage* get_res_image(short id) const; // helper for image(bool)
|
TImage* get_res_image(short id) const;
|
||||||
|
TImage* get_res_icon(short id) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void node2id(const TObject* node, TString& id) const pure;
|
virtual void node2id(const TObject* node, TString& id) const pure;
|
||||||
|
@ -1326,10 +1326,8 @@ 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));
|
XVT_COLOR_COMPONENT xcc[4]; memset(xcc, 0, sizeof(xcc));
|
||||||
xcc[0].type = XVT_COLOR_BACKGROUND;
|
xcc[0].type = XVT_COLOR_BACKGROUND;
|
||||||
xcc[0].color = BTN_BACK_COLOR;
|
xcc[0].color = BTN_BACK_COLOR;
|
||||||
xcc[1].type = XVT_COLOR_BLEND;
|
xcc[1].type = XVT_COLOR_FOREGROUND;
|
||||||
xcc[1].color = BTN_LIGHT_COLOR;
|
xcc[1].color = NORMAL_COLOR;
|
||||||
xcc[2].type = XVT_COLOR_BORDER;
|
|
||||||
xcc[2].color = BTN_DARK_COLOR;
|
|
||||||
|
|
||||||
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
|
WIN_DEF wd; memset(&wd, 0, sizeof(wd));
|
||||||
wd.wtype = WC_OUTLOOKBAR;
|
wd.wtype = WC_OUTLOOKBAR;
|
||||||
|
@ -96,13 +96,13 @@
|
|||||||
#define BMP_DIR 167
|
#define BMP_DIR 167
|
||||||
#define BMP_DIRDN 168
|
#define BMP_DIRDN 168
|
||||||
#define BMP_FILE 169
|
#define BMP_FILE 169
|
||||||
#define BMP_STOP 170
|
|
||||||
#define BMP_FILECHK 171
|
#define BMP_FILECHK 171
|
||||||
#define BMP_DIRSEL 172
|
#define BMP_DIRSEL 172
|
||||||
#define BMP_DIRDNSEL 173
|
#define BMP_DIRDNSEL 173
|
||||||
#define BMP_PDF 174
|
#define BMP_PDF 174
|
||||||
#define BMP_ARCHIVE 175
|
#define BMP_ARCHIVE 175
|
||||||
#define BMP_PROGRAM 176
|
|
||||||
#define BMP_FONT 179
|
#define BMP_FONT 179
|
||||||
#define BMP_CLOSETURN 206
|
#define BMP_CLOSETURN 206
|
||||||
#define BMP_CLOSESCONTR 207
|
#define BMP_CLOSESCONTR 207
|
||||||
|
Loading…
x
Reference in New Issue
Block a user