From c36629f7446971e30478ce588f133dbe821e01ef Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 5 Jan 2010 13:40:59 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2010.?= =?UTF-8?q?0=20Files=20correlati=20=20=20=20=20:=20ve0.exe=20Ricompilazion?= =?UTF-8?q?e=20Demo=20:=20[=20]=20Commento=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20:=200001527:=20001910=20-=20ricerca=20per=20descrizione?= =?UTF-8?q?=20-=20Presscolor=20Se=20tramite=20il=20mouse=20mi=20posiziono?= =?UTF-8?q?=20sulla=20descrizione=20articolo,=20il=20cursore=20si=20posizi?= =?UTF-8?q?ona=20ma=20lascia=20uno=20spazio,=20quindi=20scrivo=20blank+des?= =?UTF-8?q?crizione,=20cliccando=20sulla=20lente=20la=20ricerca=20sembra?= =?UTF-8?q?=20malfunzionante.=20Se=20faccio=20doppio=20click=20sulla=20rig?= =?UTF-8?q?a,=20anzich=C3=A8=20il=20puntino=20viene=20lasciato=20uno=20spa?= =?UTF-8?q?zio=20bianco?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/trunk@19872 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/maskfld.cpp | 48 +++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/include/maskfld.cpp b/include/maskfld.cpp index b6d4eca54..3e9c77a10 100755 --- a/include/maskfld.cpp +++ b/include/maskfld.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -5267,31 +5268,44 @@ void TZoom_field::create(WINDOW parent) class TZoom_mask : public TAutomask { - protected: virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); - public: - TZoom_mask(const char * prompt); - virtual ~TZoom_mask() {} + TZoom_mask(const char* prompt, int width = 70); }; bool TZoom_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) { + switch (o.dlg()) + { + case DLG_DELREC: + if (e == fe_button) + { + reset(DLG_USER); + return false; + } + break; + default: + break; + } return true; } -TZoom_mask::TZoom_mask(const char * prompt) : TAutomask("Zoom", 1, 72, 18) +TZoom_mask::TZoom_mask(const char* prompt, int width) : TAutomask(prompt, 1, width+2, 18) { const bool select = AUTOSELECT; + const bool autoend = AUTOEND; AUTOSELECT = false; AUTOEND = true; - add_memo(101, 0, prompt, 1, 0, -1, -3); - add_button(DLG_OK, 0, "", -12, -1, 10, 2); - add_button(DLG_CANCEL, 0, "", -22, -1, 10, 2); - AUTOEND = false; - AUTOSELECT = select; + + add_button_tool(DLG_OK, "", TOOL_OK); + add_button_tool(DLG_DELREC, "Azzera", TOOL_DELREC); + add_button_tool(DLG_CANCEL, "", TOOL_CANCEL); + add_memo(DLG_USER, 0, "", 1, 0, width, -2); set_handlers(); + + AUTOSELECT = select; + AUTOEND = autoend; } bool TZoom_field::on_key( KEY key ) @@ -5309,21 +5323,21 @@ bool TZoom_field::on_key( KEY key ) case K_F8: { get_window_data(); - TZoom_mask m(prompt()); + TZoom_mask m(prompt(), size()); if (__k) { - _str << (const char) __k; + _str << (const char)__k; __k = '\0'; } - m.set(101, _str); + m.set(DLG_USER, _str); if (m.run() == K_ENTER && !read_only()) { - _str = m.get(101); + _str = m.get(DLG_USER); set_window_data(raw2win(_str)); } - return TRUE; + return true; } break; default: @@ -5357,6 +5371,7 @@ const char* TZoom_field::reformat(const char* data) const const char* TZoom_field::raw2win(const char* data) const { +/* Ufficio complicazione affari semplici ai suoi massimi livelli d'espressione TFixed_string str(data); int a_capo = str.find('\n'); @@ -5368,6 +5383,9 @@ const char* TZoom_field::raw2win(const char* data) const _ctl_data._park = str; str[a_capo] = c; return _ctl_data._park; +*/ + TParagraph_string instr(data, size()); + return instr.get(0); } const char* TZoom_field::win2raw(const char* data) const