Allineati a destra tutti i campi numerici

Corretta gestione del grassetto di default


git-svn-id: svn://10.65.10.50/trunk@1185 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-03-28 16:28:10 +00:00
parent 79509e0417
commit 7924f321c4
4 changed files with 42 additions and 46 deletions

View File

@ -1,11 +1,10 @@
#ifndef __ANAFIS_H #ifndef __ANAFIS_H
#define __ANAFIS_H #define __ANAFIS_H
#define ANF_CODANAGR "CODANAGR" #define ANF_CODANAGR "CODANAGR"
#define ANF_DATANASC "DATANASC" #define ANF_DATANASC "DATANASC"
#define ANF_SESSO "SESSO" #define ANF_SESSO "SESSO"
#define ANF_STATONASC "STATONASC" #define ANF_STATONASC "STATO"
#define ANF_COMNASC "COMNASC" #define ANF_COMNASC "COMNASC"
#define ANF_COMRES "COMRES" #define ANF_COMRES "COMRES"
#define ANF_TIPOA "TIPOA" #define ANF_TIPOA "TIPOA"

View File

@ -2550,6 +2550,7 @@ word TReal_field::class_id() const
void TReal_field::create(WINDOW w) void TReal_field::create(WINDOW w)
{ {
TEdit_field::create(w); TEdit_field::create(w);
_flags.rightjust = TRUE;
if (_flags.firm) if (_flags.firm)
set(::format("%ld", main_app().get_firm())); set(::format("%ld", main_app().get_firm()));

View File

@ -37,11 +37,6 @@ public:
TString(const TString& s); // Costruttore da un oggetto TString s TString(const TString& s); // Costruttore da un oggetto TString s
virtual ~TString(); // Deallocates the string virtual ~TString(); // Deallocates the string
///////////////////////////////////////////////////////////
// @DES Methods derived from TObject
///////////////////////////////////////////////////////////
// @FPUB
virtual const char* class_name() const; // Ritorna il nome della classe virtual const char* class_name() const; // Ritorna il nome della classe
virtual word class_id() const; // Ritorna l'identificatore della classe virtual word class_id() const; // Ritorna l'identificatore della classe
virtual bool ok() const { return _str != NULL; } virtual bool ok() const { return _str != NULL; }
@ -50,11 +45,6 @@ public:
virtual void read_from(istream& in); virtual void read_from(istream& in);
virtual word hash() const; // Return hash value virtual word hash() const; // Return hash value
///////////////////////////////////////////////////////////
// @DES Query methods
///////////////////////////////////////////////////////////
// @FPUB
operator const char*() const { return (const char*)_str; } // *(TString) -> _str operator const char*() const { return (const char*)_str; } // *(TString) -> _str
char& operator[](int i) // TString[i] -> _str[i] char& operator[](int i) // TString[i] -> _str[i]
{ {
@ -81,12 +71,6 @@ public:
const TString& sub(int from, int to = -1) const; // Ritorna la stringa da FROM a TO (escluso) const TString& sub(int from, int to = -1) const; // Ritorna la stringa da FROM a TO (escluso)
const TString& right(int count) const; // Ritorna l'oggetto TString composto dai count caratteri da destra const TString& right(int count) const; // Ritorna l'oggetto TString composto dai count caratteri da destra
///////////////////////////////////////////////////////////
// @DES Modifying methods
///////////////////////////////////////////////////////////
// @FPUB
TString& fill(char c, int n = -1); // Riempie con n caratteri c TString& fill(char c, int n = -1); // Riempie con n caratteri c
TString& spaces(int n = -1) { return fill(' ', n); } TString& spaces(int n = -1) { return fill(' ', n); }
TString& overwrite(const char* s, int pos = 0); // Sovrascrive la stringa s dalla posizione pos TString& overwrite(const char* s, int pos = 0); // Sovrascrive la stringa s dalla posizione pos
@ -114,12 +98,6 @@ public:
TString& lower(); // Mette la stringa in minuscolo TString& lower(); // Mette la stringa in minuscolo
TString& add_plural(long num, const char * name); // aggiunge il plurale di name TString& add_plural(long num, const char * name); // aggiunge il plurale di name
///////////////////////////////////////////////////////////
// @DES Standard operators
///////////////////////////////////////////////////////////
// @FPUB
const TString& operator =(const TString& s) { return set(s._str); } const TString& operator =(const TString& s) { return set(s._str); }
const TString& operator =(const char* s) { return set(s); } const TString& operator =(const char* s) { return set(s); }

View File

@ -20,6 +20,7 @@ void fatal_hook()
#endif #endif
HIDDEN XVT_FNTID DEF_FONT = NULL; HIDDEN XVT_FNTID DEF_FONT = NULL;
HIDDEN XVT_FNTID FAT_FONT = NULL;
#if XVTWS == WMWS #if XVTWS == WMWS
@ -603,6 +604,7 @@ void customize_controls(bool on)
free_controls_bmp(); free_controls_bmp();
#endif #endif
xvt_font_destroy(DEF_FONT); xvt_font_destroy(DEF_FONT);
xvt_font_destroy(FAT_FONT);
} }
#ifdef DBG #ifdef DBG
@ -615,6 +617,7 @@ XVT_FNTID xvt_default_font()
if (DEF_FONT == NULL) if (DEF_FONT == NULL)
{ {
DEF_FONT = xvt_dwin_get_font(TASK_WIN); DEF_FONT = xvt_dwin_get_font(TASK_WIN);
FAT_FONT = xvt_dwin_get_font(TASK_WIN);
#if XVT_OS == XVT_OS_WIN #if XVT_OS == XVT_OS_WIN
NormalFont = GetStockObject(ANSI_FIXED_FONT); NormalFont = GetStockObject(ANSI_FIXED_FONT);
@ -637,13 +640,13 @@ XVT_FNTID xvt_default_font()
NormalFont = CreateFontIndirect(&LogFont); NormalFont = CreateFontIndirect(&LogFont);
TToken_string desc(128, '/'); TToken_string desc(128, '/');
desc.add("WIN01"); desc.add("WIN01"); // 0
desc.add(LogFont.lfHeight); desc.add(LogFont.lfHeight); // 1
desc.add(LogFont.lfWidth); desc.add(LogFont.lfWidth); // 2
desc.add(LogFont.lfEscapement); desc.add(LogFont.lfEscapement); // 3
desc.add(LogFont.lfOrientation); desc.add(LogFont.lfOrientation); // 4
desc.add(LogFont.lfWeight); desc.add(LogFont.lfWeight); // 5
desc.add(LogFont.lfItalic); desc.add(LogFont.lfItalic); // 6
desc.add(LogFont.lfUnderline); desc.add(LogFont.lfUnderline);
desc.add(LogFont.lfStrikeOut); desc.add(LogFont.lfStrikeOut);
desc.add(LogFont.lfCharSet); desc.add(LogFont.lfCharSet);
@ -659,6 +662,12 @@ XVT_FNTID xvt_default_font()
CHECK(xvt_font_is_mapped(DEF_FONT), "Can't map native font"); CHECK(xvt_font_is_mapped(DEF_FONT), "Can't map native font");
xvt_dwin_set_font(TASK_WIN, DEF_FONT); xvt_dwin_set_font(TASK_WIN, DEF_FONT);
desc.add(600, 5);
xvt_font_set_native_desc(FAT_FONT, (char*)(const char*)desc);
CHECK(xvt_font_has_valid_native_desc(FAT_FONT), "Bad font description");
xvt_font_map_using_default(FAT_FONT);
CHECK(xvt_font_is_mapped(FAT_FONT), "Can't map native font");
// Get true text size // Get true text size
TEXTMETRIC tm; TEXTMETRIC tm;
HWND hdc = (HDC)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_GRAPHIC_CONTEXT); HWND hdc = (HDC)xvt_vobj_get_attr(TASK_WIN, ATTR_NATIVE_GRAPHIC_CONTEXT);
@ -682,6 +691,14 @@ void xvt_set_font(WINDOW win, const char* family, int style, int dim)
CHECK(win != NULL_WIN, "Can't set the font in a NULL window"); CHECK(win != NULL_WIN, "Can't set the font in a NULL window");
#if XVT_OS != XVT_OS_SCOUNIX #if XVT_OS != XVT_OS_SCOUNIX
if ((family == NULL || *family == '\0') &&
(style == XVT_FS_NONE || style == XVT_FS_BOLD) &&
dim == 0)
{
xvt_dwin_set_font(win, (style == XVT_FS_NONE) ? DEF_FONT : FAT_FONT);
}
else
{
XVT_FNTID font = xvt_dwin_get_font(TASK_WIN); XVT_FNTID font = xvt_dwin_get_font(TASK_WIN);
if (family && *family) xvt_font_set_family(font, (char*)family); if (family && *family) xvt_font_set_family(font, (char*)family);
if (dim != 0) xvt_font_set_size(font, dim); if (dim != 0) xvt_font_set_size(font, dim);
@ -692,6 +709,7 @@ void xvt_set_font(WINDOW win, const char* family, int style, int dim)
xvt_dwin_set_font(win, font); xvt_dwin_set_font(win, font);
xvt_font_destroy(font); xvt_font_destroy(font);
}
#endif #endif
} }