Sign in to follow this  
Followers 0
BoBo

Show MenuItemsContent in GUI

4 posts in this topic

#1 ·  Posted (edited)

Hello again ...

I have written a GUI that contains a menu.

There are some MenuItems.

Items with Imputfields and so on.

My problem is that

If i clicked on my MenuItem it will show me the inputfields right in my GUI

... but if i choose another MenuItem afterwards the Content of the first Menuitem will be shown

and the second Menuitems overlap to the first

I want that if i click on Menuitem is should be shown in the GUI and if I click another menuitem i want to hide/delete the first GUI content which belongs to the first menuitem and show the content of the second.

I dont want a lot of windows i need only one and content in "frames"

plz help

$hauptframe = GUICreate("Testtreiber",400,400)
$menu_monisys = GUICtrlCreateMenu(" MoniSys")
$menu_monisys_parameter = GUICtrlCreateMenuitem("Parameter",$menu_monisys)
$menu_monisys_jahresplan = GUICtrlCreateMenuitem("Jahresplan",$menu_monisys)
$menu_monisys_monatplan = GUICtrlCreateMenuitem("Monatsplan",$menu_monisys)
$menu_monisys_starten = GUICtrlCreateMenuitem("Test starten",$menu_monisys)
$menu_monisys_ergebnis = GUICtrlCreateMenuitem("Ergebnisse",$menu_monisys)

$menu_bilara = GUICtrlCreateMenu("RiCo plus - BilaRa")
$menu_bilara_parameter = GUICtrlCreateMenuitem("Parameter",$menu_bilara)

GUISetState ()


While 1
    $msg = GUIGetMsg()
        Select  
    
                Case $msg = $GUI_EVENT_CLOSE
                        ExitLoop
                    
                Case $msg = $menu_monisys_parameter
        ;$Llabel = GUICtrlCreateLabel("test",50,20,300,350,$SS_BLACKFRAME)
                        $Lerf_parameter = GUICtrlCreateLabel("erforderliche Parameter",65,60,180,15)
                        $font_b = "Arial Bold"
                        GUICtrlSetFont($Lerf_parameter,10,600,4,$font_b)
                        $Lbenutzername = GUICtrlCreateLabel("Benutzername",65,100,100,15)
                        $Lpassword = GUICtrlCreateLabel("Passwort",175,100,100,15)
                        $Ljahresparameter = GUICtrlCreateLabel("Jahresauswahl",65,150,100,15)
                        $Ldatei1 = GUICtrlCreateLabel("Jahresplan",70,250,100,15)
                        $Ldatei2 = GUICtrlCreateLabel("Monatsdaten",70,300,100,15)
                        $Lsleeptimer = GUICtrlCreateLabel("Sleep - Timer in ms ",175,150,150,30)
                        $INparameter_benutzername = GuiCtrlCreateinput("",65,120,100,25)
                        $INparameter_passwort = GUICtrlCreateInput("",175,120,100,25)
                        $INparameter_jahr = GUICtrlCreateInput("",65,170,100,25)
                        $INsleeptimer = GUICtrlCreateInput("",175,170,100,25)
        ;Checkboxen

                        
                
                Case $msg = $menu_bilara_parameter
                        GUISwitch($hauptframe)
                        GUICtrlCreateButton("blablub",50,50)
    EndSelect
WEnd
Edited by BoBo

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>

$hauptframe = GUICreate("Testtreiber", 400, 400)
$menu_monisys = GUICtrlCreateMenu(" MoniSys")
$menu_monisys_parameter = GUICtrlCreateMenuItem("Parameter", $menu_monisys)
$menu_monisys_jahresplan = GUICtrlCreateMenuItem("Jahresplan", $menu_monisys)
$menu_monisys_monatplan = GUICtrlCreateMenuItem("Monatsplan", $menu_monisys)
$menu_monisys_starten = GUICtrlCreateMenuItem("Test starten", $menu_monisys)
$menu_monisys_ergebnis = GUICtrlCreateMenuItem("Ergebnisse", $menu_monisys)

$menu_bilara = GUICtrlCreateMenu("RiCo plus - BilaRa")
$menu_bilara_parameter = GUICtrlCreateMenuItem("Parameter", $menu_bilara)

;hide these
;$Llabel = GUICtrlCreateLabel("test",50,20,300,350,$SS_BLACKFRAME)
$Lerf_parameter = GUICtrlCreateLabel("erforderliche Parameter", 65, 60, 180, 15)
$font_b = "Arial Bold"
GUICtrlSetFont($Lerf_parameter, 10, 600, 4, $font_b)
$Lbenutzername = GUICtrlCreateLabel("Benutzername", 65, 100, 100, 15)
$Lpassword = GUICtrlCreateLabel("Passwort", 175, 100, 100, 15)
$Ljahresparameter = GUICtrlCreateLabel("Jahresauswahl", 65, 150, 100, 15)
$Ldatei1 = GUICtrlCreateLabel("Jahresplan", 70, 250, 100, 15)
$Ldatei2 = GUICtrlCreateLabel("Monatsdaten", 70, 300, 100, 15)
$Lsleeptimer = GUICtrlCreateLabel("Sleep - Timer in ms ", 175, 150, 150, 30)
$INparameter_benutzername = GUICtrlCreateInput("", 65, 120, 100, 25)
$INparameter_passwort = GUICtrlCreateInput("", 175, 120, 100, 25)
$INparameter_jahr = GUICtrlCreateInput("", 65, 170, 100, 25)
$INsleeptimer = GUICtrlCreateInput("", 175, 170, 100, 25)

$button = GUICtrlCreateButton("blablub", 50, 50)

_Show_Hide_monisys_parameter()
_Show_Hide_bilara_parameter()

GUISetState()


While 1
 $msg = GUIGetMsg()
 Select
  
  Case $msg = $GUI_EVENT_CLOSE
   ExitLoop
   
  Case $msg = $menu_monisys_parameter
  ;Checkboxen
   _Show_Hide_monisys_parameter(1)
   _Show_Hide_bilara_parameter()
   
  Case $msg = $menu_bilara_parameter
;~  GUISwitch($hauptframe)
   _Show_Hide_monisys_parameter()
   _Show_Hide_bilara_parameter(1)
 EndSelect
WEnd

Func _Show_Hide_monisys_parameter($Show = 0)
 Local $State
 If $Show Then
  $State = $GUI_SHOW
 Else
  $State = $GUI_HIDE
 EndIf
 GUICtrlSetState($Lerf_parameter, $State)
 GUICtrlSetState($Lbenutzername, $State)
 GUICtrlSetState($Lpassword, $State)
 GUICtrlSetState($Ljahresparameter, $State)
 GUICtrlSetState($Ldatei1, $State)
 GUICtrlSetState($Ldatei2, $State)
 GUICtrlSetState($Lsleeptimer, $State)
 GUICtrlSetState($INparameter_benutzername, $State)
 GUICtrlSetState($INparameter_passwort, $State)
 GUICtrlSetState($INparameter_jahr, $State)
 GUICtrlSetState($INsleeptimer, $State)
EndFunc  ;==>_Show_Hide_monisys_parameter

Func _Show_Hide_bilara_parameter($Show = 0)
 If $Show Then
  GUICtrlSetState($button, $GUI_SHOW)
 Else
  GUICtrlSetState($button, $GUI_HIDE)
 EndIf
EndFunc  ;==>_Show_Hide_bilara_parameter


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

WELL WELL WELL

gafrost my friend you helped me twice now :P

very big thx to you

your code is really that what i needed.....thx

;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0