a new idea to create a dialog

Post Reply
User avatar
Silvio.Falconi
Posts: 7166
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 2 times

a new idea to create a dialog

Post by Silvio.Falconi »

I would like to create something different
I explain you
Generally, we at fivewin always start from a Browse and call the insertion and modification procedures

I would like to adopt another technique but I don't know how I can do it.

When the user loads the management of an archive the procedure must already display the dialog with all the controls
as seen in the figure

Image


but the controls must be disabled except the first and first button (red circle)


Image




By pressing this button the user can view a table with the archive and
select a record.

Code: Select all | Expand


@   3,  58 BUTTONBMP oBtn1 PROMPT "..." SIZE  9,  9.6 PIXEL OF oFrmIve ;
               ACTION  Select_CodiciIva(aGet,oBtn)
 


Image


As soon as the user selects a record, all controls are populated immediately

Code: Select all | Expand

cCodice         :=  oTabIva:codice
          cDescrizione    :=  oTabIva:desc
          nTipo           :=  oTabIva:num7
          nSoggetto       :=  oTabIva:Num6
          cOpzione1       :=  oTabIva:alfa1
          cOpzione2       :=  oTabIva:alfa2


               If substr(cOpzione1,3,1)= "S"
                   lOpzione1 :=.t.
                elseif substr(cOpzione1,1,1)= "S"
                   lOpzione2 :=.t.
                elseif substr(cOpzione2,1,1)= "S"
                  lOpzione3 :=.t.
               Endif

          nAliquota     := oTabIva:num1
          nVentilazione := oTabIva:num2
          nIndetraibile := oTabIva:num5
          lComunicazione_annuale:=  IIF(substr(oTabIva:alfa1,4,1)="S",.t.,.f.)


          aGet[1]:ctext:= cCodice
          aGet[2]:ctext:= cDescrizione
          aGet[3]:nOption(nTipo)
          aGet[4]:nOption(nSoggetto)
          aGet[5]:SetCheck(lOpzione1)
          aGet[6]:SetCheck(lOpzione2)
          aGet[7]:SetCheck(lOpzione3)
          aGet[8]:ctext:= nAliquota
          aGet[9]:ctext:= nVentilazione
          aGet[10]:ctext:= nIndetraibile
          aGet[11]:SetCheck(lComunicazione_annuale)

    For n=1 to len(aget)
       aGet[n]:disable()
    next

          For n=1 to len(aget)
             aGet[n]:refresh()
          next

 


Now I use variables but here I have the problem because if I use directly che field of archive I have for a sample

oTabIva:codice instead of cCodice

then I save I cannot have the all variables


at this point the user can press the "Edit" button (Modifica) if he needs to make a edit record

the controls must be enable and the user can edit them


Code: Select all | Expand



Function Edit_Iva(aGet,oBtn,oFrmIve)

   oBtn[1]:Enable()
   oBtn[2]:Enable()
   oBtn[3]:Disable()
   oBtn[4]:Disable()

   For n=1 to len(aget)
      aget[n]:enable()
   Next

   return nil
 




any solution pls


Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Post Reply