English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Blitz Basic (https://eab.abime.net/forumdisplay.php?f=126)
-   -   MUICycle (https://eab.abime.net/showthread.php?t=93040)

AlfaRomeo 16 June 2018 12:53

MUICycle
 
Hi people,

I have a MUIPage layout already constructed inside a MUIWindow and want to make appear/desappear a new MUIString like a kind of MUIInsertSingle / MUIRemoveSingle when a MUICycle gadget is pressed.

What is the best way to do this without have to reconstruct the entire page again?


Code:

; Set some application properties
MUIApplicationTitle "3ncrYptor"
MUIApplicationDescription "MUI encrypter/Decrypter program"

Statement noRnd{}
 
  Make appear a MUIString (like a insert in the page) whithout desconstruct/reconstruct the entire page:
  MUISet 3,#MUIA_String_Accept,"0123456789"
  MUIString 4,"",6
  MUIAddObjsHGroup 6,0,2,4
  MUICreateHGroup 6
  MUIAddObjsPage 10,6


End Statement

success.l=0
myChoice.l=False
cy.l=0

;NoCli
WBStartup
FindScreen 0

Dim PageName$(2)

PageName$(0)="3ncrYpter"
PageName$(1)="d3crypt3r"

MUILabel 0,"Generate a random key?",#MUIO_Label_DoubleFrame
MUILabel 1,"The option chosen was",#MUIO_Label_DoubleFrame
MUICycle 2,"Rnd key","Yes","No"

MUIAddObjsHGroup 6,0,2
MUICreateHGroup 6

MUIAddObjsPage 10,6
MUICreatePage 10,"3ncrYpt3r","d3crYpt3r"

MUICreateWindow 11,"crYpt3r","PAGE",10
MUIAddSubWindow 11

If MUICreateApplication <> True Then End

MUINotifyApp 11,#MUIA_Window_CloseRequest,1,-11


success=MUIOpenWindow (11)

Repeat
  ev.l=MUIWaitEvent
  Select ev
    Case myChoice
      cy=MUIGetCycle (2)
      ;If cy=1 Then rndKey{}
      If cy=2 Then noRnd{}
    End Select
Until ev=-11

MUICloseWindow 11

End


Daedalus 16 June 2018 13:01

The best way to do it is to have the gadget there, but set the #MUIA_ShowMe attribute to False to make it hidden. You can then set it to True (which is 1 for MUI attributes, not -1 like elsewhere) to then make the gadget appear whenever you like, e.g. when the cycle gadget is changed.

AlfaRomeo 16 June 2018 13:29

Hi Daedalus,
Thanks for your fast answer :)

Will try the way you said :great


All times are GMT +2. The time now is 09:12.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.06568 seconds with 11 queries