Memo field connected with check box

Memo field connected with check box

Postby Ehab Samir Aziz » Sat May 31, 2008 9:20 pm

Hello
I simulate the check box example inside fwbrow.prg in \fwh\samples directory. The same code was imitated but with failure. It is not wotking .
No data tranfered from the checkbox to the field of the dbf. I use tdata class.
Also I need to connect a check box option with memo field . as in the third answer of that question :

How many years did you work :
[] one
[] Two
[] Other
________________________________
________________________________


Code: Select all  Expand view
method edit(oBrw) CLASS Taplicant
*---------------------------------
   local oDlg,oBtn,oFont

   local oaplicant:= TRecord():new( self )



   local lelected:="E" $ oaplicant:Chosen
   local lappointed:="A" $ oaplicant:Chosen
   local lOther:="O" $ oaplicant:Chosen


   if ::lAdd
      oaplicant:blank()
   endif

   DEFINE DIALOG oDlg FROM 8, 2 TO 725,1050 PIXEL ;
      TITLE if(::lAdd,"Untitled","Update") ;
          Style nor( WS_VSCROLL, WS_HSCROLL )

   *DEFINE FONT oFont NAME "Times New Roman" SIZE 0,-12 OF oDlg

   @ 1,2 SAY "&Survey ID" OF oDlg PIXEL
   @ 1,50 SAY ":" OF oDlg PIXEL
   @ 1,60 GET oaplicant:survey_no OF oDlg pict "99999" PIXEL UPDATE


   @ 20,1 SAY "Association Name" OF oDlg PIXEL
   @ 20,50 SAY ":" OF oDlg PIXEL
   @ 20,60 GET oaplicant:ass_name OF oDlg PIXEL UPDATE

   @ 40,1 SAY "Contacy Name" OF oDlg PIXEL
   @ 40,50 SAY ":" OF oDlg PIXEL


   @ 60,1 SAY "Last" OF oDlg PIXEL
   @ 60,50 SAY ":" OF oDlg PIXEL
   @ 60,60 GET oaplicant:cnt_last OF oDlg PIXEL UPDATE

   @ 60,160 SAY "First" OF oDlg PIXEL
   @ 60,210 SAY ":" OF oDlg PIXEL
   @ 60,220 GET oaplicant:cnt_first OF oDlg PIXEL UPDATE

   @ 60,320 SAY "Middle" OF oDlg PIXEL
   @ 60,370 SAY ":" OF oDlg PIXEL
   @ 60,380 GET oaplicant:cnt_middle OF oDlg PIXEL UPDATE


   @ 80,1 SAY "Position Title Within Association" OF oDlg PIXEL
   @ 80,80 SAY ":" OF oDlg PIXEL
   @ 80,90 GET oaplicant:title OF oDlg PIXEL UPDATE

   @ 100,1 SAY "Association Address1 " OF oDlg PIXEL
   @ 100,80 SAY ":" OF oDlg PIXEL
   @ 100,90 GET oaplicant:adres1 OF oDlg PIXEL UPDATE

   @ 120,1 SAY "                     Address2" OF oDlg PIXEL
   @ 120,80 SAY ":" OF oDlg PIXEL
   @ 120,90 GET oaplicant:adres2 OF oDlg PIXEL UPDATE

   @ 140,1 SAY "                     Address3" OF oDlg PIXEL
   @ 140,80 SAY ":" OF oDlg PIXEL
   @ 140,90 GET oaplicant:adres3 OF oDlg PIXEL UPDATE

   @ 160,10 TO 240, 100 LABEL "Chairperson Chosen by:" OF oDlg PIXEL

   @ 180,20 CHECKBOX lElected   PROMPT "&Elected" OF oDlg PIXEL
   @ 200,20 CHECKBOX lAppointed PROMPT "&Appointed"  OF oDlg PIXEL
   @ 220,20 CHECKBOX lOther     PROMPT "&Others" OF oDlg PIXEL


? lElected

  oaplicant:Chosen  := If( lElected, "E", "" ) + ;
                       If( lAppointed,  "A", "" ) + ;
                       If( lOther, "O", "" )




   @ 280, 10 BUTTON oBtn PROMPT "&Save" OF oDlg PIXEL SIZE 30, 12 ;
      ACTION  ( oaplicant:save(), oDlg:end() )

   @ 280, 50 BUTTON oBtn PROMPT "&Cancel" OF oDlg PIXEL SIZE 30, 12 ;
      ACTION  (  oDlg:end() )

   ACTIVATE DIALOG oDlg CENTERED

   oaplicant:end()

return self
Ehab Samir Aziz
 
Posts: 334
Joined: Fri Oct 14, 2005 1:54 pm

Postby Antonio Linares » Mon Jun 02, 2008 7:58 am

Could you provide the source code for Class TRecord ? thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Mon Jun 02, 2008 6:50 pm

Antonio,

Sorry, TRecord is part of TData, my commercial product, so I don't want him posting it.

I am working with Ehab to solve this.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Mon Jun 02, 2008 6:52 pm

Ehab,

You have to do this right before the call to save():

oaplicant:Chosen := If( lElected, "E", "" ) + ;
If( lAppointed, "A", "" ) + ;
If( lOther, "O", "" )

So, you need to put it here:

@ 280, 10 BUTTON oBtn PROMPT "&Save" OF oDlg PIXEL SIZE 30, 12 ;
ACTION ( oAplicant:chosen:= ... oaplicant:save(), oDlg:end() )

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests