Jump to content

@Melba23, Fulano, PsaltyDS, Sh3llC043r, kaotkbliss __ Help with Scroll bars on EDITBOX's [Solved]


mini
 Share

Recommended Posts

GUICtrlCreateEdit("Text", $X, $Y, $W, $H, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

Hello, i made my EditBox without any scroll bars.

Its cool, but i found that if the text im righting passes the size of the EditBox, the scrolls dont show.

I've been looking on the Help file, but i cant find how to make it to appear if text exists after passing the size of the box.

Any help will be welcome.

Edited by mini
Link to comment
Share on other sites

  • Moderators

mini,

That was more complicated that I thought it would be - but I enjoyed the challenge! :( Perhaps there is an easier way, but I could not find it.

I think this will do what you want:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <Constants.au3>
#include <WinAPI.au3>

$hGUI = GUICreate("Test", 500, 500)

$iEditWidth = 400
$iEditHeight = 400

; create edit without scroll bars
$hEdit = GUICtrlCreateEdit("", 10, 10, $iEditWidth, $iEditHeight, BitOR($ES_WANTRETURN, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL))

$hLabel = GUICtrlCreateLabel("", 420, 10, 70, 20)

GUISetState()

; Set scrolbar flags
$fHSCROLL = False
$fVSCROLL = False

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    ; Do we need scrollbars?
    _Check_Scrolls($hEdit)

WEnd

Func _Check_Scrolls($hControl)

    ; Get position of GUI
    $aPos = WinGetPos($hGUI)
    ; Create a label outside the GUI with no size parameters
    $hTester = GUICtrlCreateLabel(GUICtrlRead($hControl), $aPos[0] + $aPos[2] + 10, $aPos[1])
    ; Get the size of the label - which is the size of the text
    $aSize = ControlGetPos($hGUI, "", $hTester)
    ; Delete the label
    GUICtrlDelete($hTester)

    ; Show current size of text block less margins
    GUICtrlSetData($hLabel, $aSize[2] - 8 & " x " & $aSize[3] - 10)

    ; Check text width and adjust horizontal scroll bar style as necessary
    If $aSize[2] > $iEditWidth - 8 Then
        If $fHSCROLL = False Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitOR($iStyle, $WS_HSCROLL))
            $fHSCROLL = True
        EndIf
    Else
        If $fHSCROLL = True Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitAND($iStyle, BitNOT($WS_HSCROLL)))
            $fHSCROLL = False
            ; Force whole line to show
            ControlSend($hGUI, "", $hEdit, "{HOME}{END}")
        EndIf
    EndIf

    ; Check text height and adjust vertical scroll bar style as necessary
    If $aSize[3] > $iEditHeight - 6 Then
        If $fVSCROLL = False Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitOR($iStyle, $WS_VSCROLL))
            $fVSCROLL = True
        EndIf
    Else
        If $fVSCROLL = True Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitAND($iStyle, BitNOT($WS_VSCROLL)))
            $fVSCROLL = False
        EndIf
    EndIf

EndFunc

Ask if anything is unclear. :mellow:

M23

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

mini,

That was more complicated that I thought it would be - but I enjoyed the challenge! :( Perhaps there is an easier way, but I could not find it.

I think this will do what you want:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <Constants.au3>
#include <WinAPI.au3>

$hGUI = GUICreate("Test", 500, 500)

$iEditWidth = 400
$iEditHeight = 400

; create edit without scroll bars
$hEdit = GUICtrlCreateEdit("", 10, 10, $iEditWidth, $iEditHeight, BitOR($ES_WANTRETURN, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL))

$hLabel = GUICtrlCreateLabel("", 420, 10, 70, 20)

GUISetState()

; Set scrolbar flags
$fHSCROLL = False
$fVSCROLL = False

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    ; Do we need scrollbars?
    _Check_Scrolls($hEdit)

WEnd

Func _Check_Scrolls($hControl)

    ; Get position of GUI
    $aPos = WinGetPos($hGUI)
    ; Create a label outside the GUI with no size parameters
    $hTester = GUICtrlCreateLabel(GUICtrlRead($hControl), $aPos[0] + $aPos[2] + 10, $aPos[1])
    ; Get the size of the label - which is the size of the text
    $aSize = ControlGetPos($hGUI, "", $hTester)
    ; Delete the label
    GUICtrlDelete($hTester)

    ; Show current size of text block less margins
    GUICtrlSetData($hLabel, $aSize[2] - 8 & " x " & $aSize[3] - 10)

    ; Check text width and adjust horizontal scroll bar style as necessary
    If $aSize[2] > $iEditWidth - 8 Then
        If $fHSCROLL = False Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitOR($iStyle, $WS_HSCROLL))
            $fHSCROLL = True
        EndIf
    Else
        If $fHSCROLL = True Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitAND($iStyle, BitNOT($WS_HSCROLL)))
            $fHSCROLL = False
            ; Force whole line to show
            ControlSend($hGUI, "", $hEdit, "{HOME}{END}")
        EndIf
    EndIf

    ; Check text height and adjust vertical scroll bar style as necessary
    If $aSize[3] > $iEditHeight - 6 Then
        If $fVSCROLL = False Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitOR($iStyle, $WS_VSCROLL))
            $fVSCROLL = True
        EndIf
    Else
        If $fVSCROLL = True Then
            $iStyle   = _WinAPI_GetWindowLong(GUICtrlGetHandle($hControl), $GWL_STYLE)
            GUICtrlSetStyle($hEdit, BitAND($iStyle, BitNOT($WS_VSCROLL)))
            $fVSCROLL = False
        EndIf
    EndIf

EndFunc

Ask if anything is unclear. :mellow:

M23

LOL, as i were thinking, I'DE NEVER Whod MAKE SOMETHING LIKE THAT LOL

Well im trying to understand you Code, after that I'll implemente it to my Project, and I'll post here for ppl to see.

Thx alote for your time and your Big Challenge ^^

Thx M23

Link to comment
Share on other sites

Sorry for Dobble post.

@M23, well i manage to make my GUI to work with your code, but since i have a GUI with Tabs, and with multiple EditBox's, i found out, that if i make all EditBox's with your code.

All EditBox's shows a "refresh" "trembling" image on all of them.

Well, i were trying to make a new GUI with less coding, but i cant reproduse my problem on my main GUI.

Im posting here my Test GUI with TABs, sow if you need to check wht can you help with.

i Desbled the TabSheet1, sow i cood chek if the TabSheet2 was working with the auto-Show scroll bars, it wotks.

But if I Enable the 1st TabsSheet, the 2nd whont work.

Heres the Gui and my INI test file.

hope that some one help me on this one.

Auto_Show_Scroll_Bars_2test.rar

Link to comment
Share on other sites

  • Moderators

mini,

If you have more than one edit, you need to track the scrollbars on all of them! :mellow:

I have used a 2-D array in this script to track all the variables for all the edits - I am afraid it is a bit complex, but I have tried to explain as I go along:

#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <TabConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>

; Set the various styles we need
Global $iBase_Style = BitOR($ES_WANTRETURN, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL)
Global $iHoriz_Style = BitOR($ES_WANTRETURN, $ES_AUTOHSCROLL, $WS_HSCROLL)
Global $iVert_Style = BitOR($ES_WANTRETURN, $ES_AUTOVSCROLL, $WS_VSCROLL)
Global $iBoth_Style = BitOR($ES_WANTRETURN, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $WS_HSCROLL, $WS_VSCROLL)

; How many edits?
Global $iNum_Edits = 2
; Set up array to hold the variables for each Edit
; [0] = ControlID
; [1] = width
; [2] = height
; [3[ = horizontal scroll state
; [4] = vertical scroll state of each edit
Global $aEdit[$iNum_Edits][5]
; Set all scroll states to False
For $i = 0 To $iNum_Edits - 1
    $aEdit[$i][3] = False
    $aEdit[$i][4] = False
Next

; Create GUI
$hGui = GUICreate("Tabbed Notebook Dialog", 620, 534)
$sINI = @ScriptDir & "\2test.ini"
$PageControl1 = GUICtrlCreateTab(8, 8, 588, 450)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)

$TabSheet1 = GUICtrlCreateTabItem("TabSheet1")
; Fill array with data for this Edit
$aEdit[0][1] = 289
$aEdit[0][2] = 377
$aEdit[0][0] = GUICtrlCreateEdit("", 216, 48, $aEdit[0][1], $aEdit[0][2], $iBase_Style)

$TabSheet2 = GUICtrlCreateTabItem("TabSheet2")
; Fill array with data for this Edit
$aEdit[1][1] = 289
$aEdit[1][2] = 277
$aEdit[1][0] = GUICtrlCreateEdit("", 216, 48, $aEdit[1][1], $aEdit[1][2], $iBase_Style)

GUICtrlCreateTabItem("")

;Button
$Procurar = GUICtrlCreateButton("Find", 22, 484, 75, 25)
;Input
$InputIDCB = GUICtrlCreateInput("IDCB", 289, 484, 135, 21)
$InputNome = GUICtrlCreateInput("", 109, 484, 135, 21)

GUISetState(@SW_SHOW)

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Procurar
            _Check4Procurar()
            $sText = StringReplace(IniRead($sINI, GUICtrlRead($InputIDCB), "Observações", "N / A"), "\n", @CRLF)
            GUICtrlSetData($aEdit[0][0], $sText)
            $sText = StringReplace(IniRead($sINI, GUICtrlRead($InputIDCB), "DP", "N / A"), "\n", @CRLF)
            GUICtrlSetData($aEdit[1][0], $sText)
    EndSwitch

    ; Run through the edits to see if we need scrollbars
    For $i = 0 To $iNum_Edits - 1
        _Check_Scrolls($i)
    Next

WEnd

Func _Check4Procurar()
    GUICtrlSetData($InputNome, IniRead("2test.ini", GUICtrlRead($InputIDCB), "Nome", "N / A"))
EndFunc   ;==>_Check4Procurar

Func _Check_Scrolls($iIndex)

    ; Select the edit ControlID from the array
    $hControl = $aEdit[$iIndex][0]

    ; Get position of GUI
    $aPos = WinGetPos($hGui)
    ; Create a label outside the GUI with no size parameters
    $hTester = GUICtrlCreateLabel(GUICtrlRead($hControl), $aPos[0] + $aPos[2] + 10, $aPos[1])
    ; Get the size of the label - which is the size of the text
    $aSize = ControlGetPos($hGui, "", $hTester)
    ; Delete the label
    GUICtrlDelete($hTester)

    ; Check text width and adjust horizontal scroll bar style as necessary
    If $aSize[2] > $aEdit[$i][1] - 8 Then ; compare to Edit width
        ; We need a Horiz scrollbar
        If $aEdit[$i][3] = False Then ; If no Horis scrollbar we need to add it
            If $aEdit[$i][4] = True Then ; Check if Vert scrollber exists
                ; Both needed
                GUICtrlSetStyle($hControl, $iBoth_Style)
                ConsoleWrite("Both" & @CRLF)
            Else
                ; Only Horiz needed
                GUICtrlSetStyle($hControl, $iHoriz_Style)
                ConsoleWrite("Horiz" & @CRLF)
            EndIf
            $aEdit[$i][3] = True
        EndIf
    Else
        ; No Horiz scrollbar needed
        If $aEdit[$i][3] = True Then
            ; We do not need a Horiz scrollbar
            If $aEdit[$i][4] = True Then ; Check if Vert scrollbar exists
                ; Only Vert needed
                GUICtrlSetStyle($hControl, $iVert_Style)
                ConsoleWrite("Vert" & @CRLF)
            Else
                ; Meither needed
                GUICtrlSetStyle($hControl, $iBase_Style)
                ConsoleWrite("Base" & @CRLF)
            EndIf
            $aEdit[$i][3] = False
            ; Force whole line to show
            ControlSend($hGui, "", $hControl, "{HOME}{END}")
        EndIf
    EndIf

    ; Check text height and adjust vertical scroll bar style as necessary
    If $aSize[3] > $aEdit[$i][2] - 6 Then
        If $aEdit[$i][4] = False Then
            If $aEdit[$i][3] = True Then
                ; Both needed
                GUICtrlSetStyle($hControl, $iBoth_Style)
                ConsoleWrite("Both" & @CRLF)
            Else
                ; Only Vert needed
                GUICtrlSetStyle($hControl, $iVert_Style)
                ConsoleWrite("Vert" & @CRLF)
            EndIf
            $aEdit[$i][4] = True
        EndIf
    Else
        If $aEdit[$i][4] = True Then
            If $aEdit[$i][3] = True Then
                ; Only Horiz needed
                GUICtrlSetStyle($hControl, $iHoriz_Style)
                ConsoleWrite("Horiz" & @CRLF)
            Else
                ; Neither needed
                GUICtrlSetStyle($hControl, $iBase_Style)
                ConsoleWrite("Base" & @CRLF)
            EndIf
            $aEdit[$i][4] = False
        EndIf
    EndIf

EndFunc   ;==>_Check_Scrolls

I hope you can follow it - I am well aware of how complicated it looks, but it is really not that difficult to follow! :( Please do ask if you have any problems.

M23

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

mini,

If you have more than one edit, you need to track the scrollbars on all of them! :(

I have used a 2-D array in this script to track all the variables for all the edits - I am afraid it is a bit complex, but I have tried to explain as I go along:

I hope you can follow it - I am well aware of how complicated it looks, but it is really not that difficult to follow! :P Please do ask if you have any problems.

M23

OMG....

Well i've never try to make any "Array" because im not sow in of programing.

If you have more than one edit, you need to track the scrollbars on all of them! :lol:

Well, in fact i have 7 Tabs with 7 Edit's, its just a matter of aspect that im trying to change now.

My brother have to make/ask for the image of the program and for hes "layout".

Since its not really finished, im trying to make it good looking. :mellow:

Heres how it looks like.

post-41776-12683493839154_thumb.jpg

post-41776-12683494445671_thumb.jpg

Edited by mini
Link to comment
Share on other sites

  • Moderators

mini,

OMG....Well i've never try to make any "Array"

DO NOT PANIC!!!! :P I have done all the work for you - you just need to set the number of edits here:

; How many edits?
Global $iNum_Edits = 2  ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

and then when you create each edit, set the width and height like this - just replace the question mark with 0 for the first edit, 1 for the second, 2 for the third, etc (I know it sounds mad, but arrays start at 0, not 1, in AutoIt :mellow: ):

; Fill array with data for this Edit
$aEdit[?][1] = 289 ; Width
$aEdit[?][2] = 377 ; Height
$aEdit[?][0] = GUICtrlCreateEdit("", 216, 48, $aEdit[0][1], $aEdit[0][2], $iBase_Style)

Then put this in your While...WEnd loop:

; Run through the edits to see if we need scrollbars
For $i = 0 To $iNum_Edits - 1
    _Check_Scrolls($i)
Next

And make sure the _Check_Scrolls function is in your script.

Everything else is done for you. :(

M23

P.S. But arrays are important - there is a good tutorial in the Wiki to help you understand how they work. :lol:

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

LOL

My panic, after reading all you did, is the last part.

I've understand well the the indication of the "Styles", "Numb of Edits", the concetp of the statment of true or false is understadable, the creaction of the edit box's to. :mellow:

The hard part for me was to understand the "Func _Check_Scrolls($iIndex)", this part is more dificult, because, theres values that dont "exist" but they are created to make a Default parameter.

In fact, i cood understand the part of the Vert and Horiz scrolls on true false, but this part

; Select the edit ControlID from the array
    $hControl = $aEdit[$iIndex][0]

    ; Get position of GUI
    $aPos = WinGetPos($hGui)
    ; Create a label outside the GUI with no size parameters
    $hTester = GUICtrlCreateLabel(GUICtrlRead($hControl), $aPos[0] + $aPos[2] + 10, $aPos[1])
    ; Get the size of the label - which is the size of the text
    $aSize = ControlGetPos($hGui, "", $hTester)
    ; Delete the label
    GUICtrlDelete($hTester)

made me very confused.

but im trying to understad it.

One more thing, can you post that link of the wiki sow i can read it to!?

Thx for your wonderful Array code you made :(

EDIT:

Another question:

$sINI = @ScriptDir & "\Base de Contactos BES.ini"

EX:   $sINI = @ScriptDir & GUICtrlRead($InputIDCB)

in that part, is it possible to make it to check for a Input name???

IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputIDCB) , "Nome" , GUICtrlRead($InputNome))

EX:   IniWrite ( GUICtrlWrite($InputIDCB), GUICtrlRead($InputIDCB) , "Nome" , GUICtrlRead($InputNome))

and when writing on file, is it possible to make several .ini's with a input name???

Edited by mini
Link to comment
Share on other sites

  • Moderators

mini,

Let me explain that code in more detail: :(

1. We look in the array to get the ControlID of each Edit in turn (remember we saved the ControlIDs when we created the Edits so we could do this). We get the value $iIndex as a parameter - it is taken from the index of the For...Next loop which calls the function so we run through each Edit in turn.

; Select the edit ControlID from the array
$hControl = $aEdit[$iIndex][0]

2. We need to find the width and height of the text in the Edit. We use a little trick here - if we do not specify the width and height of a label, AutoIt will automatically set the label to the correct size for the text. But if we put the text of the Edit into a label, we must make sure that we cannot see the label in the GUI - so we need to create the label OUTSIDE the GUI. The label will still exist - it is just that we cannot see it.

; Get position of GUI
$aPos = WinGetPos($hGui) ; We now have the GUI position and size
; Create a label outside the GUI with no size parameters
$hTester = GUICtrlCreateLabel(GUICtrlRead($hControl), $aPos[0] + $aPos[2] + 10, $aPos[1])

If you work it out, we are creating the label just to the right of the GUI:

;          +-----------+  +----------=   $aPos[0] + $aPos[2] = Left coord of GUI + GUI width
;          |           |  |          |   $aPos[1] = Top coord of GUI
;          |  GUI      |  | Label    |
;          |           |  |          |
;          +-----------+  +----------=

And we are setting the content of the label to the text of the Edit by using GUICtrlRead($hControl).

3. We now ask Autoit how big it had to make the label to fit in the text:

; Get the size of the label - which is the size of the text
$aSize = ControlGetPos($hGui, "", $hTester)

$aSize[2] will be the width and $aSize[3] will be the height of the text in the Edit. We can use these values to compare with the size of the Edit and so decide if we need scrollbars.

4. Finally we get rid of the label ready to create a new one for the next Edit:

; Delete the label
GUICtrlDelete($hTester)

I hope that is clearer. :mellow:

M23

P.S. The Wiki array tutorial is here.

Edit: Clarification of the clarification. :lol:

Edited by Melba23

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

mini,

And yet more questions appear! :P

is it possible to make it to check for a Input name

Your code is pretty close, but you will need to add a "\" and perhaps a check to make sure that the Input actually has a value in it! :mellow:

While 1
    If GUICtrlRead($InputIDCB) <> "" ; Check if the input has something in it
        $sINI = @ScriptDir & "\" & GUICtrlRead($InputIDCB)
        ExitLoop ; Leave the While...WEnd loop
    EndIf
    Sleep(10) ; A little idle time for the CPU
WEnd

and when writing on file, is it possible to make several .ini's with a input name

I do not understand what you want to do. :lol:

And what is this GUICtrlWrite command? I cannot find that in the Help file! :(

M23

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

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Melba23,

mini,

And yet more questions appear! :D

Well , a friend of me, says: For programing a DB you need to know that the client for what your making the Data Base, will always Ask to make several changes when your creating hes "program".

You have to be prepared to that challenge and expect for does changes ^^

I do not understand what you want to do. :P

And what is this GUICtrlWrite command? I cannot find that in the Help file! :evil:

Its the fith time im trying to write you my question, but im havin trubble to express my self.

I add a Image sow it can be more simple.

The GUI have the INPUT CLIENT.

(Lets start there)

I'm trying to know if i can make the INPUT CLIENT name, sow when i save the info, the .ini file is saved with the INPUT CLIENT name.

SOW:

problem 1: I'm using this to identify my INI file on the program...

$sINI = @ScriptDir & "\Base de Contactos BES.ini"

Problem 2: when i press SAVE, i use this code here on the "While loop"...

Case $Save
            _Check4Save()   
            $sText = StringReplace(GUICtrlRead($aEdit[0][0], $sText), @CRLF, "\n")
            IniWrite($sINI, GUICtrlRead($InputIDCB) , "Observações", $sText)

and this one on the "Func _Chek4Save"...

Func _Check4Save()
$answer = MsgBox(36, "Aviso", "Tem a certeza que quer gravar?",8)
If $answer = 6 Then
    IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputIDCB) , "Nome" , GUICtrlRead($InputNome))

Problem 3: is the Searching part, i use this code here on the "While loop"...

Case $Search
            _Check4Search()
            $sText = StringReplace(IniRead($sINI, GUICtrlRead($InputIDCB), "Observações", "Não disponivel"), "\n", @CRLF)
            GUICtrlSetData($aEdit[0][0], $sText)

and this one on the "Func _Check4Search"

Func _Check4Search()
GUICtrlSetData ($InputNome, IniRead ("Base de Contactos BES.ini", GUICtrlRead($InputIDCB) , "Nome", "Não disponivel"))

Well, since im making a Big question now, i notice, that if i whant to make this change, im going to re-write almost my program, sow i can implement this way of storing my DATA.

Hope that i were more explicit now and you get what im saying.

Best regards and thanks for your patience and free time.

:mellow::(:lol:

EDIT: AND YES, you clarify me on the priviest post, well i got a better idea of what its doing :P

post-41776-12684251667073_thumb.jpg

Edited by mini
Link to comment
Share on other sites

Here my almost final GUI...

Im just waiting to see if my brother needs anymore changes on the program.

But please, I'd like to shear with you and all the ppl that wants to use it for some other projects,

because you made some cool things on it, specially the Scroll bars.

Sow i shout-out to Melba23, Fulano, PsaltyDS, Sh3llC043r, kaotkbliss Thx for all the help.

BES.rar

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...