Jump to content

GuiBuilderPlus [updated March 24, 2024]


Recommended Posts

@kurtykurtyboy For the record, this works for me :

#include <GUIConstantsEx.au3>
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
    Local $hGUI = GUICreate("RichEdit Set Tab Stops with \deftabN", 500, 300)
    Local $hRichEdit = _GUICtrlRichEdit_Create($hGUI, "", 1, 1, 498, 298, _
        BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL, $WS_HSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_NOHIDESEL))

    Local $sRTFtext = _
        '{\rtf1\ansi\ansicpg1252\deff0\deflang1036\deftab416{\fonttbl{\f0\fswiss\fcharset0 Arial;}}' & @crlf & _
        '{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\f0\fs20 1234567890123456789012345678901234567890\par' & @crlf & _
        'ab\par' & @crlf & _
        '}'

    _GUICtrlRichEdit_SetText($hRichEdit, $sRTFtext)

    GUISetState()
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    _GUICtrlRichEdit_Destroy($hRichEdit)
EndFunc   ;==>Example

RTF-text-in-Rich-Edit-using-deftab-N.png

I added \deftab416 (using NotePad) and each Tab Stop corresponds to 4 characters on any line (Font used when creating the RTF with WordPad was Arial 10)
Hope it will work for you too
Edited by pixelsearch
Link to comment
Share on other sites

Interesting, after playing with your code a bit, it looks like it has something to do with _GUICtrlRichEdit_StreamFromVar vs _GUICtrlRichEdit_SetText.

If I make just 2 small edits inside the RESH UDF, everything seems to be working great.

In _RESH_SyntaxHighlight, change from _StreamFromVar to _SetText:

;~  _GUICtrlRichEdit_StreamFromVar($hRichEdit, $sCode)
    _GUICtrlRichEdit_SetText($hRichEdit, $sCode)

Then in __RESH_HeaderFooter, add '\deftab416' after the first string:

"\rtf1\ansi\ansicpg1252\deff0\deflang1033\deftab416"

image.png.24c5512299acbe1bb58b42c4c7af14da.png

I'm not sure if there was a reason the RESH UDF was using _StreamFromVar, but it seems to be working fine so far without it...

Anyway, thanks for the help @pixelsearch - I think it looks much better now.

Link to comment
Share on other sites

9 hours ago, mLipok said:

Why not to use scite lexer dll ?

I thought about it, but the RESH UDF was extremely easy to just drop in and it worked. Syntax highlighting was just something that was nice to have. Since this is not a full IDE, I didn't want to spend too much time on it.

Link to comment
Share on other sites

11 minutes ago, kurtykurtyboy said:

I thought about it, but the RESH UDF was extremely easy to just drop in and it worked. Syntax highlighting was just something that was nice to have. Since this is not a full IDE, I didn't want to spend too much time on it.

I had a plan (in the past) to make an quick editor - I mean easy to embed.
If I do it in the future I will back here with the same sugestion.

Signature beginning:
* Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
* ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * 

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * 

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors  * HTML editor * 

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

On 5/5/2023 at 9:12 AM, Skeletor said:

When I try to create two rectangles, the first which is blue, disappears.

Finally found the bug. Here's the fix, if you're interested and running from source.

In _display_selection_rect, make this change:

;~  If GUICtrlGetHandle($overlay) <> -1 Then
    If $overlay <> -1 Then

 

Link to comment
Share on other sites

  • kurtykurtyboy changed the title to GuiBuilderPlus [updated May 10, 2023]

Updated zip in the first post with a couple bug fixes and updates. I created my own sort of build process to streamline new releases, so let me know if I missed anything in the zip.

  • FIXED: Bug when resizing the Code Generation window
  • FIXED: Bug control randomly disappears
  • FIXED: More seamless positioning of resize handles when crossing zero
  • FIXED: Code preview was not always updating
  • ADDED: New property "Image" for Icon and Pic controls with selection dialog
  • UPDATED: Smaller tab width in code preview
Edited by kurtykurtyboy
Link to comment
Share on other sites

9 hours ago, kurtykurtyboy said:

What do you think of these Icons? Just playing around with different options... It definitely makes things look a little more modern.

As so often, design lies in the eye of the respective beholder ;). For me personally, I prefer the new icons too, and yes, they look more 'modern'.

 

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

12 hours ago, kurtykurtyboy said:

What do you think of these Icons? Just playing around with different options... It definitely makes things look a little more modern.

That is fantastic @kurtykurtyboy ... those should be standard. 

Are they all 32x32?

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Link to comment
Share on other sites

@kurtykurtyboy The first icon pack is available. More to come.
This is the flat black design.

image.png.c8c2c0acf71851d5fc91ab88fc797ee5.png

 

 

Flat_Black_Design.zip

Edited by Skeletor

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Link to comment
Share on other sites

This next icon set is based on the logo colors. This icon set is called the Flat Ocean Design, in both grey or white backgrounds.

image.png.f64023bb9da713e0efaa3fc1782c1f67.png    image.png.0a0dc7d1ac7a7d4816d2d7e5fdbb1c4c.png

Ocean_Icons.zip

Edited by Skeletor

Kind Regards
Skeletor

"Coffee: my defense against going postal."

Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI

Link to comment
Share on other sites

  • kurtykurtyboy changed the title to GuiBuilderPlus [updated March 24, 2024]

It's been a while... updated with some fixes and improvements.

  • FIXED: Wrong line endings when copying from code preview window
  • FIXED: Issue changing properties when Obect Explorer window is not open
  • FIXED: Issue when selecting controls under certain other conditions
  • FIXED: SaveAs keyboard shortcut
  • FIXED: Undo/Redo for Global property
  • ADDED: Auto-size property for Labels, Buttons, and Inputs
Link to comment
Share on other sites

  • 6 months later...

Looks good! I would like to be able to stretch the window down to avoid scrolling.

I can't import a file created with Koda. Can you fix it?

Edited by winkot
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...