From 4301d9487b0f39b10ae510a7446a552823041879 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 3 Jan 2007 16:53:05 +0000 Subject: [PATCH] Patch level : 4.0 nopatch Files correlati : Ricompilazione Demo : [ ] Commento : aggiunte xvt_chr_is_digit, xvt_chr_is_alpha e xvt_chr_is_alnum git-svn-id: svn://10.65.10.50/trunk@14717 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/controls.cpp | 2 +- include/maskfld.cpp | 2 +- include/msksheet.cpp | 2 +- include/printer.h | 8 ++++---- include/xvtility.cpp | 2 +- xvaga/xvaga.cpp | 17 ++++++++++++++++- xvaga/xvt.h | 5 +++++ 7 files changed, 29 insertions(+), 9 deletions(-) diff --git a/include/controls.cpp b/include/controls.cpp index 0deedef77..d25f243a5 100755 --- a/include/controls.cpp +++ b/include/controls.cpp @@ -72,7 +72,7 @@ KEY TControl::xiev_to_key(const XI_EVENT* xiev) if (xiev->v.chr.shift && (k < ' ' || k >= K_UP)) key += K_SHIFT; //if (xiev->v.chr.control && k >= ' ') key += K_CTRL; // Correzione per gestire i tasti AltGr sulle tastiere non U.S.A. - if (xiev->v.chr.control && (k > K_SHIFT || (k >= K_F1 && k <= K_F12) || isalnum(k) || strchr("\r+-*/",k) != NULL)) + if (xiev->v.chr.control && (k > K_SHIFT || (k >= K_F1 && k <= K_F12) || xvt_chr_is_alnum(k) || strchr("\r+-*/",k) != NULL)) key += K_CTRL; } return key; diff --git a/include/maskfld.cpp b/include/maskfld.cpp index df07d28f9..be381f59b 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -5094,7 +5094,7 @@ bool TZoom_field::on_key( KEY key ) } break; default: - if (AUTOZOOM && isalnum(key)) + if (AUTOZOOM && xvt_chr_is_alnum(key)) { get_window_data(); if (_str.len() >= size()) diff --git a/include/msksheet.cpp b/include/msksheet.cpp index d6968a1d6..e1aa642d7 100755 --- a/include/msksheet.cpp +++ b/include/msksheet.cpp @@ -1494,7 +1494,7 @@ bool TSpreadsheet::event_handler(XI_OBJ* itf, XI_EVENT *xiev) { KEY k = xiev_to_key(xiev); - if (isalnum(k)) + if (xvt_chr_is_alnum(k)) digit_timer = clock(); else { diff --git a/include/printer.h b/include/printer.h index 716368513..578e5b6ed 100755 --- a/include/printer.h +++ b/include/printer.h @@ -289,7 +289,7 @@ class TPrinter : public TObject LINKHANDLER _linkhandler; // @cmember:(INTERNAL) Caratteri per fincatura - char _fink[11]; + TString16 _fink; // @cmember:(INTERNAL) Flag per aggiungere ad una stampa su file gia' esistente (TRUE aggiunge in coda, FALSE sovrascrive) bool _appendfile; @@ -452,11 +452,11 @@ public: { return _multiple_link; } // @cmember Ritorna i caratteri di fincatura - const char* get_fincatura() - { return _fink; } + const char* get_fincatura() const + { return (const char *) _fink; } // @cmember Setta i caratteri di fincatura void set_fincatura(const char* s) - { strncpy(_fink, s, sizeof(_fink)); } + { _fink.strncpy(s, 11); } // @cmember Setta/forza il tipo di fincatura void set_fink_mode(bool f) ; diff --git a/include/xvtility.cpp b/include/xvtility.cpp index dc3b6b9ed..8976b2223 100755 --- a/include/xvtility.cpp +++ b/include/xvtility.cpp @@ -246,7 +246,7 @@ KEY e_char_to_key( key += K_SHIFT; //if (ep->v.chr.control && key >= ' ') key += K_CTRL; if (ep->v.chr.control && (key > K_SHIFT || (key >= K_F1 && key <= K_F12) || - isalnum(key) || strchr("\r+-*/",key) != NULL)) + xvt_chr_is_alnum(key) || strchr("\r+-*/",key) != NULL)) key += K_CTRL; } return key; diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index 75ea1cd8d..94d0e1b71 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -885,7 +885,7 @@ void TwxWindow::OnChar(wxKeyEvent& event) if (event.AltDown()) { e.v.chr.control = TRUE; - if (isalnum(k)) + if (xvt_chr_is_alnum(k)) k = toupper(k); else { @@ -4181,6 +4181,21 @@ double xvt_str_fuzzy_compare (const char* s1, const char* s2) return fstrcmp(s1, s2); } +BOOLEAN xvt_chr_is_digit(int c) +{ + return (c <= 255) && wxIsdigit(c); +} +BOOLEAN xvt_chr_is_alpha(int c) +{ + return (c <= 255) && wxIsalpha(c); +} + +BOOLEAN xvt_chr_is_alnum(int c) +{ + return (c <= 255) && wxIsalnum(c); +} + + /////////////////////////////////////////////////////////// // XVT system calls (added by Guy) /////////////////////////////////////////////////////////// diff --git a/xvaga/xvt.h b/xvaga/xvt.h index cba78e10f..f0752ae87 100755 --- a/xvaga/xvt.h +++ b/xvaga/xvt.h @@ -298,6 +298,11 @@ XVTDLL double xvt_str_fuzzy_compare (const char* s1, const char* s2); XVTDLL void xvt_str_make_upper(char* str); XVTDLL void xvt_str_make_lower(char* str); +XVTDLL BOOLEAN xvt_chr_is_digit(int c); +XVTDLL BOOLEAN xvt_chr_is_alpha(int c); +XVTDLL BOOLEAN xvt_chr_is_alnum(int c); + + // System calls by XVAGA XVTDLL void xvt_sys_beep(int severity); XVTDLL long xvt_sys_execute(const char* cmdline, BOOLEAN sync, BOOLEAN iconizetask);