From: Alain A. <ala...@wa...> - 2015-12-06 10:15:51
|
Hi, I have a windows where I have gets, and two buttons Cancel and Validate If I modify a get, and without changing the focused get, I hit the button accept, the value of the get isn't updated, and I save the old value. Is there a way to validate it automatically ? Thanks A+ -- ------------------------------------------------------------------------ Alain Aupeix http://jujuland.pagesperso-orange.fr/ http://pissobi-lacassagne.pagesperso-orange.fr/ ------------------------------------------------------------------------ U.buntu 12.04 | G.ramps 3.4.9-1 | H.arbour 3.2.0dev (2015-11-25 14:06) | HbIDE (Rev.316) | Five.Linux (r143) | Hw.Gui (2501) ------------------------------------------------------------------------ |
From: Alexander S.K. <al...@be...> - 2015-12-10 11:25:20
|
Alain Aupeix пишет: > Hi, > > I have a windows where I have gets, and two buttons Cancel and Validate > > If I modify a get, and without changing the focused get, I hit the > button accept, You said that there are "two buttons Cancel and Validate". What is "button accept" ? It could be easier, if you provide a small code snippet. Regards, Alexander. |
From: Alain A. <ala...@wa...> - 2015-12-10 14:23:29
|
Le 10/12/2015 12:24, Alexander S.Kresin a écrit : > Alain Aupeix пишет: >> Hi, >> >> I have a windows where I have gets, and two buttons Cancel and Validate >> >> If I modify a get, and without changing the focused get, I hit the >> button accept, > You said that there are "two buttons Cancel and Validate". What is > "button accept" ? Sorry, it was the button Validate ... > It could be easier, if you provide a small code snippet. It's really a very simple problem, but I dont know it it will be possible to solve it. I have for example two gets which are initialized with strings. If I modify the content of one get and hit the button validate without changing the focused get, the modification isn't taken ... #include "windows.ch" #include "guilib.ch" #include "gtk.ch" #include "inkey.ch" REQUEST HB_CODEPAGE_UTF8 REQUEST HB_CODEPAGE_FR850 REQUEST DBFNTX REQUEST ORDKEYNO REQUEST ORDKEYCOUNT memvar rMachine, rSystem, cButton function main() local oMainWindow, getlist, oValid, oCancel public rMachine:="name of machine", rSystem:="Ubuntu 12.04", cButton INIT WINDOW oMainWindow MAIN TITLE "Get and validate test ..." AT 200,50 SIZE 350,395 @ 10,10 SAY "Modify the name and hit <Enter> key" SIZE 340, 20 @ 10,30 SAY "then, Modify the system and hit <Valid> button" SIZE 340, 20 clear gets @ 10,60 SAY "Machine Name:" SIZE 130, 20 @ 185,60 GET rMachine SIZE 140, 20 BACKCOLOR 13296771 COLOR hwg_VColor("0000FF") @ 10,85 SAY "Machine System :" SIZE 130, 20 @ 185,85 GET rSystem SIZE 140, 20 BACKCOLOR 13296771 COLOR hwg_VColor("0000FF") @ 80,120 OWNERBUTTON oValid ON CLICK {||Valid_Edit("Valid")} ; SIZE 80, 27 ; BITMAP "valider.png" TRANSPARENT COLOR 13890771 @ 95,150 SAY "Valid" SIZE 80, 27 @ 200,120 OWNERBUTTON oCancel ON CLICK {||Valid_Edit("Cancel")} ; SIZE 80, 27 ; BITMAP "annuler.png" TRANSPARENT COLOR 13890771 @ 220,150 SAY "Cancel" SIZE 80, 27 @ 10,190 SAY "You will see that the last modified get, without" SIZE 340, 20 @ 10,210 SAY "hitting <enter> after, isn't modified." SIZE 340, 20 @ 10,230 SAY "A 2nd <Valid> modify it, first ought to be enough." SIZE 340, 20 @ 10,252 SAY "----------------------------------------------------------------------------------" SIZE 340, 10 @ 10,270 SAY "Another bug : at the beginning, click after the end" SIZE 340, 20 @ 10,290 SAY "of a get, and enter something : it's entered at the" SIZE 340, 20 @ 10,310 SAY "beginning of the get." SIZE 340, 20 @ 10,330 SAY "Editing cursor position isn't modified when using" SIZE 340, 20 @ 10,350 SAY "the mouse. Same problem when leaving the get" SIZE 340, 20 @ 10,370 SAY "for another program and returning in the get ..." SIZE 340, 20 ACTIVATE WINDOW oMainWindow return nil // ============================================================================ Function Valid_Edit(cButton) // ============================================================================ run("ls") hwg_Msginfo(rMachine+chr(13)+chr(10)+rSystem,"You hit "+cButton+" button") if cButton == "Cancel" rMachine:="name of machine" rSystem:="Ubuntu 12.04" endif return nil Thanks A+ -- ------------------------------------------------------------------------ Alain Aupeix http://jujuland.pagesperso-orange.fr/ http://pissobi-lacassagne.pagesperso-orange.fr/ ------------------------------------------------------------------------ U.buntu 12.04 | G.ramps 3.4.9-1 | H.arbour 3.2.0dev (2015-12-05 09:58) | HbIDE (Rev.316) | Five.Linux (r143) | Hw.Gui (2503) ------------------------------------------------------------------------ |