Dlg Update and insert new control

Dlg Update and insert new control

Postby Eoeo » Fri Aug 24, 2012 3: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: Select all  Expand view

#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
 
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm

Re: Dlg Update and insert new control

Postby kok joek hoa » Fri Aug 24, 2012 3:46 pm

Dear Eoeo,

Try this :

Code: Select all  Expand view

#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
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: Dlg Update and insert new control

Postby Eoeo » Fri Aug 24, 2012 7:19 pm

RUN GOOD THANKS
User avatar
Eoeo
 
Posts: 222
Joined: Mon Jun 04, 2012 12:00 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 93 guests