Jump to content

Recommended Posts

 
Hey
I would like to open the tabs only when you click on the sub-item "Endpoint" and this tab should appear once for the menu items ABS, FRET and LUM. Can someone help me?

 

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <MsgBoxConstants.au3>

#Region ### START Koda GUI section ### Form=
$Settings = GUICreate("Settings", 615, 438, 192, 124)
$mFile = GUICtrlCreateMenu("&File")
$mNew = GUICtrlCreateMenuItem("&New", $mFile)
GUICtrlSetState(-1, $GUI_DEFBUTTON)
$mOpen = GUICtrlCreateMenuItem("&Open", $mFile)
$mSave = GUICtrlCreateMenuItem("&Save", $mFile)
$mSaveas = GUICtrlCreateMenuItem("&Save as", $mFile, 1)
GUICtrlCreateMenuItem("", $mFile, 4)
$mExit = GUICtrlCreateMenuItem("&Exit", $mFile)
$mABS = GUICtrlCreateMenu("&ABS")
$mEndpoint_ABS = GUICtrlCreateMenuItem("&Endpoint", $mABS)
$mKinetic_ABS = GUICtrlCreateMenu("&Kinetic", $mABS)
$mWellScan_ABS = GUICtrlCreateMenu("&Well Scan", $mABS)
$mSpectrum_ABS = GUICtrlCreateMenu("&Spectrum", $mABS)
$mFRET = GUICtrlCreateMenu("&FRET")
$mEndpoint_FRET = GUICtrlCreateMenuItem("&Endpoint", $mFRET)
$mKinetic_FRET = GUICtrlCreateMenu("&Kinetic", $mFRET)
$mWellScan_FRET = GUICtrlCreateMenu("&Well Scan", $mFRET)
$mLUM = GUICtrlCreateMenu("&LUM")
$mEndpoint_LUM = GUICtrlCreateMenuItem("&Endpoint", $mLUM)
$mKinetic_LUM = GUICtrlCreateMenu("&Kinetic", $mLUM)
$mWellScan_LUM = GUICtrlCreateMenu("&Well Scan", $mLUM)
$mSpectrum_LUM = GUICtrlCreateMenu("&Spectrum", $mLUM)
$mFragezeichen = GUICtrlCreateMenu("&?")
$mHelp_Fragezeichen = GUICtrlCreateMenuItem("Help" & @TAB & "F1", $mFragezeichen)
$Button_Cancel = GUICtrlCreateButton("Cancel", 450, 370, 70, 20)
$Button_OK = GUICtrlCreateButton("OK", 530, 370, 70, 20)
GUICtrlSetState(-1, $GUI_FOCUS)
Local $idTab = GUICtrlCreateTab(0, 10, 620, 355)
                $wave = GUICtrlCreateTabItem("Wavelengths")
                $Label_NumberW = GUICtrlCreateLabel("Number of Wavelenghts:", 10, 40, 170, 20)
                $Input_Wavelenghts = GUICtrlCreateInput("", 150, 37, 70, 20)
                GUICtrlCreateUpdown($Input_Wavelenghts)
                $Label_Lm1 = GUICtrlCreateLabel("Lm1", 120, 70, 20, 20)
                $Input_Lm1 = GUICtrlCreateInput("", 150, 67, 70, 20)
                $Label_nm = GUICtrlCreateLabel("nm", 230, 70, 70, 20)
                Local $Pic_Spektrum = GUICtrlCreatePic("C:\Users\Admin\Pictures\Spektrum.jpg", 10, 100, 500, 150)
                $Button_700nm = GUICtrlCreateButton ("700 nm", 35, 210, 50, 20)
                GUICtrlSetBkColor(-1, 0xFF0000)
                $Button_650nm = GUICtrlCreateButton ("650 nm", 100, 210, 50, 20)
                GUICtrlSetBkColor(-1, 0xFFA500 )
                $Button_600nm = GUICtrlCreateButton ("600 nm", 165, 210, 50, 20)
                GUICtrlSetBkColor(-1, 0xFFFF00)
                $Button_550nm = GUICtrlCreateButton ("550 nm", 230, 210, 50, 20)
                GUICtrlSetBkColor(-1, 0x008000)
                $Button_500nm = GUICtrlCreateButton ("500 nm", 295, 210, 50, 20)
                GUICtrlSetBkColor(-1, 0x0000FF)
                $Button_450nm = GUICtrlCreateButton ("450 nm", 360, 210, 50, 20)
                GUICtrlSetBkColor(-1, 0x191970)
                GUICtrlSetColor(-2, 0xFFFFFF)
                $Button_400nm = GUICtrlCreateButton ("400 nm", 430, 210, 50, 20)
                GUICtrlSetBkColor(-1, 0xEE82EE)
                GUISetState(@SW_SHOW)
                GUICtrlCreateTabItem("Plate Type")
                $Label_NumberP = GUICtrlCreateLabel("Number of Plates:", 10, 40, 109, 20)
                $Input_NumberP = GUICtrlCreateInput("", 120, 37, 70, 20)
                GUICtrlCreateUpdown($Input_NumberP)
                $Group_Plate_Bottom = GUICtrlCreateGroup("", 5, 55, 230, 130)
                $Label_Plate_Bottom = GUICtrlCreateLabel ("Choose Platebottom:", 10, 70, 109, 20)
                $Radio_PlateAuswahl_U = GUICtrlCreateRadio ("96-U", 120, 70, 50, 20)
                $Radio_PlateAuswahl_V = GUICtrlCreateRadio ("96-V", 120, 100, 50, 20)
                $Radio_PlateAuswahl_F = GUICtrlCreateRadio ("96-F", 120, 130, 50, 20)
                $Radio_PlateAuswahl_C = GUICtrlCreateRadio ("96-C", 120, 160, 50, 20)
                $Group_Plate_Bottom = GUICtrlCreateGroup("", 5, 175, 230, 130)
                $Label_PlateMaterial = GUICtrlCreateLabel ("Plate material:", 10, 190, 109, 20)
                $Radio_highbinding = GUICtrlCreateRadio("high-binding", 120, 190, 100, 20)
                $Radio_normalbinding = GUICtrlCreateRadio("normal-binding", 120, 220, 100, 20)
                $Radio_notbinding = GUICtrlCreateRadio("not-binding", 120, 250, 100, 20)
                GUICtrlCreateTabItem("Read Area")
                $Checkbox_allWells = GUICtrlCreateCheckbox("Select All", 545, 45, 97, 17)
                Local $Pic_Wellplate = GUICtrlCreatePic("C:\Users\Admin\Pictures\Wellplatepic.jpg", 70, 60, 467, 300)
                $Button_A = GUICtrlCreateButton ("A->", 35, 110, 40, 20) ; AUSSTEHEND: einzelne Wells/Reihen/Spalten/Alles markieren
                $Button_B = GUICtrlCreateButton ("B->", 35, 155, 40, 20)
                $Button_C = GUICtrlCreateButton ("C->", 35, 200, 40, 20)
                $Button_D = GUICtrlCreateButton ("D->", 35, 245, 40, 20)
                $Button_E = GUICtrlCreateButton ("E->", 35, 290, 40, 20)
                $Button_F = GUICtrlCreateButton ("F->", 35, 335, 40, 20)
                $Button_1 = GUICtrlCreateButton ("1", 125, 45, 40, 20)
                $Button_2 = GUICtrlCreateButton ("2", 175, 45, 40, 20)
                $Button_3 = GUICtrlCreateButton ("3", 225, 45, 40, 20)
                $Button_4 = GUICtrlCreateButton ("4", 275, 45, 40, 20)
                $Button_5 = GUICtrlCreateButton ("5", 325, 45, 40, 20)
                $Button_6 = GUICtrlCreateButton ("6", 375, 45, 40, 20)
                $Button_7 = GUICtrlCreateButton ("7", 425, 45, 40, 20)
                $Button_8 = GUICtrlCreateButton ("8", 475, 45, 40, 20)
                GUICtrlCreateTabItem("PTM and Optics")
                GUICtrlCreateTabItem("Shake")
                $Label_Shake_Question = GUICtrlCreateLabel("Should the plate be shaken?", 10, 40, 145, 20)
                Local $Radio_Shake_Yes = GUICtrlCreateRadio("Yes", 170, 37, 70, 20)
                Local $Radio_Shake_No = GUICtrlCreateRadio("No", 250, 37, 70, 20)
                GUICtrlSetState($Radio_Shake_Yes, $GUI_CHECKED)
                $Label_Shakespeed = GUICtrlCreateLabel("Shaking speed:", 10, 70, 100, 20)
                $Input_Shakespeed = GUICtrlCreateInput("", 100, 65, 70, 20)
                GUICtrlCreateTabItem("More Settings")
                GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

 While 1
         global $nMsg = GUIGetMsg()
         Select
             Case $nMsg = $GUI_EVENT_CLOSE
                    Exit
             Case $nMsg = $Button_Cancel
                 Exit
             Case $nMsg = $mExit
                 Exit
            Case $nMsg = $mOpen
            FileOpenDialog(" Open some File...", @WindowsDir, "All(*.*)")
            Case $nMsg =  $Radio_Shake_No And BitAND(GUICtrlRead($Radio_Shake_No), $GUI_CHECKED) = $GUI_CHECKED
                GUICtrlSetState($Input_Shakespeed,$GUI_Disable)

            Case $nMsg = $Radio_Shake_Yes And BitAND(GUICtrlRead($Radio_Shake_Yes), $GUI_CHECKED) = $GUI_CHECKED
                GUICtrlSetState($Input_Shakespeed,$GUI_enable)

            Case $nMsg =  $mHelp_Fragezeichen
            Local $iMsgBoxAnswer
            $iMsgBoxAnswer = MsgBox(289, "Help", "Just ask Annika.")
         EndSelect
    WEnd

 

Edited by Jos
added codebox... please use <> next time.
Link to post
Share on other sites
  • AUTOLAB changed the title to Tabs in Menu
5 minutes ago, AUTOLAB said:

Hey Jos, can you explain your comment in more detail?

https://www.autoitscript.com/wiki/Forum_FAQ#How_can_I_post_.22code.22_on_the_forum_.3F

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * for other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2021-10-18

Link to post
Share on other sites

A few comments on your While Loop :

1- You should not declare variables inside a loop, declare it before (best practices)

2- Use Switch instead of Select, will easily allow you to have multiple ids in a single case

3- GUICtrlRead on radio and check boxes can only return 2 values (see help file).  No need to bitAnd the result.

Local $sFile

While True
  Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE, $Button_Cancel, $mExit
      Exit
    Case $mOpen
      $sFile = FileOpenDialog(" Open some File...", @WindowsDir, "All(*.*)")
    Case $Radio_Shake_No
      If GUICtrlRead($Radio_Shake_No) = $GUI_CHECKED Then GUICtrlSetState($Input_Shakespeed, $GUI_DISABLE)
    Case $Radio_Shake_Yes
      If GUICtrlRead($Radio_Shake_Yes) = $GUI_CHECKED Then GUICtrlSetState($Input_Shakespeed, $GUI_ENABLE)
    Case $mHelp_Fragezeichen
      MsgBox(289, "Help", "Just ask Annika.")
    Case $mEndpoint_ABS
      GUICtrlSetState($wave, $GUI_SHOW)
  EndSwitch
WEnd

 

Edited by Nine
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...