kamuline

GUICtrlCreateInput on top

7 posts in this topic

#1 ·  Posted (edited)

Hi

I try to use some input boxes in a listview, but the default value is only visible if i click inside the box, and it disappears if i click somewhere else.

Is there anything i can do about it.

Thx for the help

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <Guilistview.au3>
#include <EditConstants.au3>
#include <File.au3>
$gui = GUICreate("Order", 210, 300, -1, -1)
Global $List = GUICtrlCreateListView("", 1, 1, 204, 300,-1,BitOR($LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES))
GUISetState()
_Fill()
While 1
    $msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd
Func _Fill()
    Dim $Materials[5] = ["mat 1", "mat 2", "mat 3", "mat 4", "mat 5"]
    _GUICtrlListView_AddColumn($List,"Materials",100)
    _GUICtrlListView_AddColumn($List,"Quantity",100)
    Dim $aInput[UBound($Materials)]
    For $i = 1 To UBound($Materials)
        _GUICtrlListView_AddItem($List, $Materials[$i-1])
        $aInput[$i-1] = GUICtrlCreateInput("1", 105, 4 + (17 * $i), 90, 17,$ES_NUMBER)
        GUICtrlSetState($aInput[$i-1],$GUI_ONTOP)
        GUICtrlSetLimit($aInput[$i-1], 3)
    Next
EndFunc

 

Edited by kamuline

Share this post


Link to post
Share on other sites



#2 ·  Posted

kamuline,

My GUIListViewEx UDF (look in my sig for the link) allows you to have editable items within a ListView - you might want to take alook.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

Ty, but its really a beast. :)

Share this post


Link to post
Share on other sites

#4 ·  Posted

kamuline,

if you are referring to the UDF, then I freely admit that it is a complex beast. But if you tell me what parts of your ListView need to be editable I will be happy to help you get it working as you require.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

The second column, Quantity.

Thanks for helping.

Share this post


Link to post
Share on other sites

#6 ·  Posted

kamuline,

This works for me:

#include <GUIConstantsEx.au3>

#include "GUIListViewEx.au3"

$gui = GUICreate("Order", 210, 300)
$List = GUICtrlCreateListView("", 1, 1, 204, 300)
; Always best to set the extended ListView styles like this
; And yo uneed the FULLROWSELECT extended style for the UDF to work
_GUICtrlListView_SetExtendedListViewStyle($List, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_CHECKBOXES))

GUISetState()

_Fill()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

    _GUIListViewEx_EventMonitor() ; This lets the UDF do its magic
WEnd

Func _Fill()
    Local $Materials[5] = ["mat 1", "mat 2", "mat 3", "mat 4", "mat 5"]
    _GUICtrlListView_AddColumn($List, "Materials", 100)
    _GUICtrlListView_AddColumn($List, "Quantity", 100)

    ; initialise the ListView
    $iList_Index = _GUIListViewEx_Init($List, "")
    ; Set column 1 to be an edit with an updown from 0 to 3
    _GUIListViewEx_SetEditStatus($iList_Index, 1, 1, 1, "0|3|1")
    ; Insert the data - tellign the UDF that the array elementas are separate rows
    _GUIListViewEx_Insert($Materials, True)
    ; Register the NOTIFY messages - no need for the others
    _GUIListViewEx_MsgRegister(True, False, False, False)

EndFunc   ;==>_Fill

Please ask if you have any questions.

M23

1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#7 ·  Posted

Thank you. It's really useful.

If i insist to my inputboxes, let me ask a dummy question. Is it possible to put the inputs to a list that scrolles down like a normal list?

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