FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Dlg Update and insert new control
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Dlg Update and insert new control
Posted: Fri Aug 24, 2012 03:37 PM
I wish insert a new control ( a get ) then the user press the "insert" button and I want clear all get or combobox are into dlg . How I can make it ?


the test source to try :
when I press "Insert" the value lFirstrow is changed but it not refresh the dlg and not insert the new control


Code (fw): Select all Collapse
#include "fivewin.ch"


Function test()

Local lFirstrow :=.T.
Local ctext1:=space(10),ctext2:=space(10) ,cField
local aGet[3]
Local aItems :={'FIRST','LAST','STREET','CITY','STATE'}

DEFINE DIALOG oDlg SIZE 500,500


     IF !lFirstrow

      @ 120,10  GET aGet[1]  VAR ctext1     OF oDlg  size 40,10 PIXEL

   ENDIF
      @ 120,58 COMBOBOX aGet[2] VAR cField ITEMS aItems     OF oDlg   SIZE 50,60 PIXEL     STYLE CBS_DROPDOWN

      @ 120,195 GET aGet[3] VAR ctext2  OF oDlg  size 45,10  PIXEL

      @5,20 BUTTON  oBtn PROMPT "Insert" ACTIOn ADD( lFirstrow,oDlg,aGet)

ACTIVATE DIALOG oDlg

RETURN NIL



Function ADD( lFirstrow,oDlg, oControl)

lFirstrow:=.F.

odlg:update()

RETURN NIL
Posts: 117
Joined: Tue Jan 03, 2006 06:18 PM
Re: Dlg Update and insert new control
Posted: Fri Aug 24, 2012 03:46 PM
Dear Eoeo,

Try this :

Code (fw): Select all Collapse
#include "fivewin.ch"


Function test()

Local lFirstrow :=.T.
Local ctext1:=space(10),ctext2:=space(10) ,cField
local aGet[3]
Local aItems :={'FIRST','LAST','STREET','CITY','STATE'}
local odlg, obtn

DEFINE DIALOG oDlg SIZE 500,500



      @ 120,10  GET aGet[1]  VAR ctext1     OF oDlg  size 40,10 PIXEL

      @ 120,58 COMBOBOX aGet[2] VAR cField ITEMS aItems     OF oDlg   SIZE 50,60 PIXEL     STYLE CBS_DROPDOWN

      @ 120,195 GET aGet[3] VAR ctext2  OF oDlg  size 45,10  PIXEL

      @5,20 BUTTON  oBtn PROMPT "Insert" ACTIOn ADD(oDlg,aGet)

ACTIVATE DIALOG oDlg ;
        on init aGet[1]:hide()

RETURN NIL

static function  ADD( oDlg,aGet)

   aGet[1]:show()
   odlg:refresh()


return nil



regards,

kok
Posts: 222
Joined: Mon Jun 04, 2012 12:00 PM
Re: Dlg Update and insert new control
Posted: Fri Aug 24, 2012 07:19 PM

RUN GOOD THANKS

Continue the discussion