Jump to content

Recommended Posts

Posted

I was wondering how to create a excel spreadsheet type thing. starting with a one column list, then when a box

(eventually to contain a word). When one was clicked a nother smaller window opens, and there is a 2x3 spreadsheet inside

like this (hope no one minds poor texty pics): :">

First list:

_________

|_word___|

|_word___|

|_word___|

|_word___|

|_word___|

|_word___|

|_word___|

When a word is clicked:

__________

|_word___|

|_word___|*** ___________

|_word___|< >| _sub1___|__sub4___|

************| __sub2__|__sub5___|

************| __sub3__|___sub6__|

|_word___|

|_word___|

*ignore asteriks*

Sry again

But ya thats what im looking for

anyone got sugestions?

Thanks for help

(if anyone understands this) :">

Posted

I was wondering how to create a excel spreadsheet type thing. starting with a one column list, then when a box

(eventually to contain a word). When one was clicked a nother smaller window opens, and there is a 2x3 spreadsheet inside

like this (hope no one minds poor texty pics): :">

First list:

_________

|_word___|

|_word___|

|_word___|

|_word___|

|_word___|

|_word___|

|_word___|

When a word is clicked:

__________

|_word___|

|_word___|*** ___________

|_word___|< >| _sub1___|__sub4___|

************| __sub2__|__sub5___|

************| __sub3__|___sub6__|

|_word___|

|_word___|

*ignore asteriks*

Sry again

But ya thats what im looking for

anyone got sugestions?

Thanks for help

(if anyone understands this) :">

I'm not totally sure I understand you, maybe you are looking for GuiCtrlCreateMenu()?

Posted

I dunno if anyone here is familair with the whole spanish verb conjugation tree, but thats my purpose for the program. to display all the words in one convinient program. Unfortunatly, I know it would most likey be easier in C++ or VC++ or something other than AutoIt, but AutoIt is the only language Im familiar with, the only thing Im not familiar with in AutoIt however, is GUI.

So anyway, I want it to work like this:

Its like theres is a list of the infinative forms of the verbs(the one column list)

And then when you click on one infinative, a window(preferrably a closable one) opens next to the click infinative and all six of the conjugations are displayed(the 2x3 window).

I know this would take forever to ask someone to write entirely, so obviously thats not what i'm asking for. I just need a Code for a GUI chart template tha i could use to make a list as long as I want, and Have room to input words

I just need help with the GUI aspect of it. I can do the rest

TY again PLZ Help

I will give credit too you for your help if you can provide a template for me.

Then Every Spanish student in my school will have to read your name (or Nickname) when the program starts.

Posted

heres one approach ( use files to hold the text you want to display

Taken from Lesson #6 of "Welcome to Autoit 1-2-3"

; includes
#include <GuiConstants.au3>
#include <file.au3>

;****************** FILE LOCATION **********

$File_loc = @ScriptDir & "\"
$File_type = "*.txt"

;********************************************


; create the GUI.
$win = GUICreate("File List/View Demo", 614, 370)
; set the font for the GUI
GUISetFont(9, 400, -1, "MS Sans Serif")
; create buttons.
$btnList = GUICtrlCreateButton("&List Files", 10, 330, 75, 25)
$btnView = GUICtrlCreateButton("&View File", 85, 330, 75, 25)
; create the left list.
$TutorItList = GUICtrlCreateList("", 10, 10, 150, 330)
; create the right edit.
$TutorItEdit = GUICtrlCreateEdit("Please select a tutorial from the list to your left.", 175, 10, 420, 345, $ES_AUTOVSCROLL + $ES_READONLY + $ES_MULTILINE + $WS_VSCROLL)
; set the edit colors.
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlSetColor(-1, 0x000000)
; set focus to the edit.
GUICtrlSetState($TutorItList, $GUI_FOCUS)
; show the GUI.
GUISetState()

; start the loop.
While 1
; listen for a message
    $msg = GUIGetMsg()
; using select/case for the message
    Select
        Case $msg = $GUI_EVENT_CLOSE 
            Exit
        Case $msg = $btnList
            Set_tutor()
        Case $msg = $btnView
            View_tutor()
; end the selections        
    EndSelect
    
WEnd

; Function to populate the left list.
Func Set_tutor()
    $TutList = _FileListToArray ($File_loc, $File_type, 1); list files to an array.
    If (Not IsArray($TutList)) Or (@error = 1) Then
        MsgBox(262208, "Tutor Error", "No Files\Folders Found.   ", 5)
        Return
    EndIf
    GUICtrlSetData($TutorItList, ""); set list to empty.
    For $x = 1 To $TutList[0]; for loop to place the files in the list.
        GUICtrlSetData($TutorItList, (StringTrimRight($TutList[$x], 4)) & "|", 1); string trim the last 4 characters ( .txt )
    Next
EndFunc   

; Function to populate the right edit.
Func View_tutor()
    $s_text = GUICtrlRead($TutorItList); read the selected file to a variable.
    If $s_text = "" Then Return
    $n_text = StringTrimLeft($File_type, 1)
    $s_text = $File_loc & $s_text & $n_text; set the location of the file.
    Dim $Tut_text
    If Not _FileReadToArray($s_text, $Tut_text) Then; read the file to an array.
        MsgBox(4096, "Tutor Error", " Error reading log to Array     error:" & @error)
        Return
    EndIf
    GUICtrlSetData($TutorItEdit, ""); set the edit to empty.
    For $x = 1 To $Tut_text[0]; for loop to place the read file into the edit.
        GUICtrlSetData($TutorItEdit, $Tut_text[$x] & @CRLF, 1)
    Next
EndFunc

8)

NEWHeader1.png

Posted

TreeView??

#include <GUIConstants.au3>

Global Const $TV_FIRST      = 0x1100 
Global Const $TVM_EXPAND    = $TV_FIRST + 2
Global Const $TVE_TOGGLE    = 0x0003


GUICreate("My GUI with treeview", 350, 215)

$treeview      = GUICtrlCreateTreeView(6, 6, 100, 150, BitOr($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE)
$generalitem    = GUICtrlCreateTreeViewitem("General", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$displayitem    = GUICtrlCreateTreeViewitem("Display", $treeview)
GUICtrlSetColor(-1, 0x0000C0)
$aboutitem    = GUICtrlCreateTreeViewitem("About", $generalitem)
$compitem      = GUICtrlCreateTreeViewitem("Computer", $generalitem)
$useritem      = GUICtrlCreateTreeViewitem("User", $generalitem)
$resitem        = GUICtrlCreateTreeViewitem("Resolution", $displayitem)
$otheritem    = GUICtrlCreateTreeViewitem("Other", $displayitem)

$startlabel  = GUICtrlCreateLabel("TreeView Demo",190,90,100,20)
$aboutlabel  = GUICtrlCreateLabel("This little scripts demonstates the using of a treeview-control.", 190, 70, 100, 60)
GUICtrlSetState(-1, $GUI_HIDE) ; Hides the "aboutlabel"-text during initialization
$compinfo      = GUICtrlCreateLabel("Name:" & @TAB & @ComputerName & @LF & "OS:" & @TAB & @OSVersion & @LF & "SP:" & @TAB & @OSServicePack, 120, 30, 200, 80)
GUICtrlSetState(-1, $GUI_HIDE) ; Hides the "compinfo"-text during initialization

GUICtrlCreateLabel("", 0, 170, 350, 2, $SS_SUNKEN)
$togglebutton   = GUICtrlCreateButton("&Toggle", 35, 185, 70, 20)
$infobutton  = GUICtrlCreateButton("&Info", 105, 185, 70, 20)
$statebutton    = GUICtrlCreateButton("Col./Exp.", 175, 185, 70, 20)
$cancelbutton   = GUICtrlCreateButton("&Cancel", 245, 185, 70, 20)

GUICtrlSetState($generalitem, BitOr($GUI_EXPAND,$GUI_DEFBUTTON))   ; Expand the "General"-item and paint in bold
GUICtrlSetState($displayitem, BitOr($GUI_EXPAND,$GUI_DEFBUTTON))   ; Expand the "Display"-item and paint in bold

GUISetState ()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $cancelbutton Or $msg = $GUI_EVENT_CLOSE
            ExitLoop
    
        Case $msg = $togglebutton  ; Toggle the bold painting
            If BitAnd(GUICtrlRead($generalitem), $GUI_DEFBUTTON) Then
                GUICtrlSetState($generalitem, 0)
                GUICtrlSetState($displayitem, 0)
            Else
                GUICtrlSetState($generalitem, $GUI_DEFBUTTON)
                GUICtrlSetState($displayitem, $GUI_DEFBUTTON)
            EndIf
        
        Case $msg = $infobutton
            $item = GUICtrlRead($treeview)   ; Get the controlID of the current selected treeview item
            If $item = 0 Then
                MsgBox(64, "TreeView Demo", "No item currently selected")
            Else
                $advmsg = GUICtrlRead($item, 1); Get advanced infos about the treeview item
                If ($advmsg[0] == 0) Then
                    MsgBox(16, "Error", "Error while retrieving infos about item")
                Else
                    MsgBox(64, "TreeView Demo", "Current item selected is: " & $advmsg[0]) ; $advmsg[0] contains the text and $advmsg[1] the state value of the treeview item
                EndIf
            EndIf
            
        Case $msg = $statebutton
            $item = GUICtrlRead($treeview)
            If $item > 0 Then
                $hItem = GUICtrlGetHandle($item)
                GuiCtrlSendMsg($treeview, $TVM_EXPAND, $TVE_TOGGLE, $hItem)
            EndIf
            
       ; The following items will hide the other labels (1st and 2nd parameter) and then show the 'own' labels (3rd and 4th parameter)
        Case $msg = $generalitem
            GUIChangeItems($aboutlabel, $compinfo, $startlabel, $startlabel)
        
        Case $msg = $aboutitem
            GUICtrlSetState ($compinfo, $GUI_HIDE)
            GUIChangeItems($startlabel, $startlabel, $aboutlabel, $aboutlabel)
            
        Case $msg = $compitem
            GUIChangeItems($startlabel, $aboutlabel, $compinfo, $compinfo)
    EndSelect
WEnd

GUIDelete()
Exit

Func GUIChangeItems($hidestart, $hideend, $showstart, $showend)
    Local $idx
    
    For $idx = $hidestart To $hideend
        GUICtrlSetState ($idx, $GUI_HIDE)
    Next
    For $idx = $showstart To $showend
        GUICtrlSetState ($idx, $GUI_SHOW)
    Next    
EndFunc

8)

NEWHeader1.png

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
×
×
  • Create New...