Jump to content

How to do word wrap in ListBox?


AndreyS
 Share

Recommended Posts

Thank PhoenixXL that you do not forget about me! :)
Now it works fine for me with version 3.3.8.1!
 
Remains to be done so that when you click on an item the function (GUICtrlSetOnEvent($hRichEdit_,"Func1") or GUICtrlRead($hRichEdit_)) was called with the return of the item number or its contents. I'll have to think about how to do it. But I think the most fundamental thing you have done! Thank you again!
Edited by AndreyS
Link to comment
Share on other sites

Try to refrain from using -3 and opt for $GUI_EVENT_CLOSE instead. Also I'm not getting any errors with APIIConstants.au3. What version of then beta are you using please PhoenixXL?

 

I will surely make it a habit for using Variables rather than the magic numbers. Sorry for this time

The error are in the APIConstants of AndreyS, as we can see it in post >#14, that too not in beta.

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

  • 1 month later...

Add the following function to EditList.au3

Func _Edit_List_GetSelItem()
    Return _GUICtrlRichEdit_GetSelText($h_ControlHwnd)
EndFunc

Ask for any other modification( but try before that )

Regards :)

Phoenix XL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Check the original post for the modified version.

Regards :)

Phoenix XL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

Excellent work! :) Thank you PhoenixXL!
I would also like to be completely happy to make the response to pressing buttons. For example, when pushed down arrows focus moved down to the next element of the control. And to show up vertical scroll bar if the elements very much.
Link to comment
Share on other sites

It was possible to scroll bar to display a combination of the following styles: BitOR ($ WS_VSCROLL, $ ES_AUTOVSCROLL, $ ES_MULTILINE)).
 
It remains to figure out how to control the selection of items by using the keys. If it is of course possible at all.
Link to comment
Share on other sites

EditList is basically a RichEdit control - an UDF created control

So you have to manage its appearance and disappearance in accordance with your code.

For an example look in Tabs Wiki.

Regards :)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

  • 4 weeks later...
Still trying to implement a solution.
PhoenixXL, tell me how to get rid of the next defect?
After cleaning monitor and add new elements, it starts wrong allocate the first elements. He seemed to remember the number of characters in the previous set.
Please try this example:
#include <EditList.au3>

$hMain = GUICreate("Test", 500, 300)
Global $hRichEdit_ = _Edit_List_Create(10, 10, 300, 200, $hMain)

_Edit_List_InsertItem("1. The usual high-level elements for functions, loops and expression-handling.")
_Edit_List_InsertItem("2. A staggering amount of string handling functions and a Perl Compatible Regular Expression Engine(PCRE)")
_Edit_List_InsertItem("3. COM support")
_Edit_List_InsertItem("4. Call Win32 and Third-Party DLL APIs.")
_Edit_List_InsertItem("1. The usual high-level elements for functions, loops and expression-handling.")
_Edit_List_InsertItem("2. A staggering amount of string handling functions and a Perl Compatible Regular Expression Engine(PCRE)")
_Edit_List_InsertItem("3. COM support")
_Edit_List_InsertItem("4. Call Win32 and Third-Party DLL APIs.")
_Edit_List_SetOnClick("OnClick_Handler")

_GUICtrlRichEdit_SetText($hRichEdit_, "")

_Edit_List_InsertItem("3. COM support")
_Edit_List_InsertItem("4. Call Win32 and Third-Party DLL APIs.")
_Edit_List_InsertItem("1. The usual high-level elements for functions, loops and expression-handling.")
_Edit_List_InsertItem("2. A staggering amount of string handling functions and a Perl Compatible Regular Expression Engine(PCRE)")
_Edit_List_InsertItem("3. COM support")
_Edit_List_InsertItem("4. Call Win32 and Third-Party DLL APIs.")

GUISetState()

_SendMessage($hRichEdit_, $WM_SETFOCUS) ;required for initial hiding of the caret


While GUIGetMsg() <> -3
    Sleep(10)
WEnd

Func OnClick_Handler()
    ConsoleWrite("Item Selected: " & _Edit_List_GetSelItem() & @CRLF)
EndFunc
Link to comment
Share on other sites

Also, if another control EditList, add, as a result can not see any one of them.

Global $hRichEdit2_ = _Edit_List_Create(310, 10, 300, 200, $hMain)
I use in my program another RTF and noticed that he was no longer created.
 
 
PhoenixXL, help me, please fix these two problems.
Link to comment
Share on other sites

I use in my program another RTF and noticed that he was no longer created.

Download the latest BETA, multiple richedit creation problem was fixed.

I will post back soon(by tomorrow) for the problem. :)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

I have added the parameter for index to insert an item.

Items could also be removed.

I will soon add option to scroll by arrow buttons.Added!

Check the original code

Edit: also added support of ENTER key.

Let me know for any bugs or further modifications.

Regards :)

Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

PhoenixXL, thank you for the next improvement UDF new features! :)
I see a new feature _Edit_List_RemoveItem.
It is necessary to ensure that new elements after the removal of old , correctly allocated ? In this case, works! But I would like to be able to remove all the elements at once. Is it possible to do this?
 
I still add style - I think it is even necessary if a large list .
$ h_ControlHwnd = _GUICtrlRichEdit_Create ($ hWin, "", $ iX, $ iY, $ iWidth, $ iHeight, BitOR ($ WS_VSCROLL, $ ES_MULTILINE))
 
 
And tell me is there any hope to work two RichEdit component? Without the second I can not do nothing. :( In the first RE (EditList) is a choice, and the second RE ( usual standard ) displays the text with special formatting . There hope?
Edited by AndreyS
Link to comment
Share on other sites

There hope?

 

Oh! of course friend, I have >already said you to do try with the latest beta, multiple richedit problems bug was fixed there.

Plus the style was already included in the UDF.

Again modified the script, use the function _Edit_List_Clear(), to remove all items at once.

Regards :)

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

  • Moderators

AndreyS,

If I were you I would use the latest release instead. ;)

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

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

×
×
  • Create New...