Sign in to follow this  
Followers 0
jacekr

Revers order in GUICtrlCreateList

5 posts in this topic

Hello

I'm using GUICtrlCreateList as a program log:

...
$log=GUICtrlCreateList("", 10, 150, 100, 150, BitOR($BS_PUSHLIKE, $SS_LEFT))
GUICtrlSetData($log,$log_message&"|")
...

I have two problems:

- first, when there is more lines than the size of the control, there is no updown arrow available, why?

- second, I would like to reverse the order in which these lines are entered to the control, by default

the oldest entry is on the first place, and the newest (recently added) is at the bottom of the list, is it possible to change it?

Best Regards

JR

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hello

I'm using GUICtrlCreateList as a program log:

...
$log=GUICtrlCreateList("", 10, 150, 100, 150, BitOR($BS_PUSHLIKE, $SS_LEFT))
GUICtrlSetData($log,$log_message&"|")
...

I have two problems:

- first, when there is more lines than the size of the control, there is no updown arrow available, why?

Because although the default style for a list includes a vertical scroll bar, you have removed it by specify your own styles. I don't think the styles $BS_PUSHLIKE and $SS_LEFT are doing anything useful for you though I have no idea what the they are there for.

- second, I would like to reverse the order in which these lines are entered to the control, by default

the oldest entry is on the first place, and the newest (recently added) is at the bottom of the list, is it possible to change it?

Best Regards

JR

You can insert an item at the start rather than the end by using _GuiCtrlListBox_InsertString and then _GuiCtrlListBox_AddSubItem.

You might need to make sure that the styles do not include $LBS_SORT. So you would need to set the style like this for example

$log=GUICtrlCreateList("", 10, 150, 100, 150, BitOR($WS_BORDER,$WS_VSCROLL,$WS_TABSTOP,$LBS_NOTIFY))

;or
$log=GUICtrlCreateList("", 10, 150, 100, 150, BitAnd($GUI_SS_DEFAULT_LIST,BitNot($LBS_SORT)))

Welcome to the AutoIt forums jacekr ;)

EDIT: Corrected function names which I referred to

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Because although the default style for a list includes a vertical scroll bar, you have removed it by specify your own styles. I don't think the styles $BS_PUSHLIKE and $SS_LEFT are doing anything useful for you though I have no idea what the they are there for.

You can insert an item at the start rather than the end by using _GuiCtrlList_InsertString and then _GuiCtrlList_AddSubItem.

You might need to make sure that the styles do not include $LBS_SORT. So you would need to set the style like this for example

$log=GUICtrlCreateList("", 10, 150, 100, 150, BitOR($WS_BORDER,$WS_VSCROLL,$WS_TABSTOP,$LBS_NOTIFY))

;or
$log=GUICtrlCreateList("", 10, 150, 100, 150, BitAnd($GUI_SS_DEFAULT_LIST,BitNot($LBS_SORT)))

Welcome to the AutoIt forums jacekr ;)

Hi,

Thanks for the reply, but I cannot find such functions like: _GuiCtrlList_InsertString and _GuiCtrlList_AddSubItem.

I guess that there is no "group" _GuiCtrlList_*

Share this post


Link to post
Share on other sites

Hi,

Thanks for the reply, but I cannot find such functions like: _GuiCtrlList_InsertString and _GuiCtrlList_AddSubItem.

I guess that there is no "group" _GuiCtrlList_*

Sorry, I should have said _GuiCtrlListBox* (or _GuiCtrListView*)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Sorry, I should have said _GuiCtrlListBox* (or _GuiCtrListView*)

Ok, thank you for help. Similarly to you suggestion, I've solved it like this:

_GUICtrlListBox_AddString($log, $log_message)

_GUICtrlListBox_InsertString($log, $log_message, 0)

...

after inital _AddString, InsertString with index 0 can be used and it's working.

Regards

JR

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
Sign in to follow this  
Followers 0