Jump to content

GUICtrlCreateInput on top


kamuline
 Share

Recommended Posts

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

  • Moderators

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

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

  • 2 weeks later...
  • Moderators

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

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

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

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

  • 4 weeks later...

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...