Jump to content

Ini Editor


sandin
 Share

Recommended Posts

One last fix for your setTrans() func. If you want to use a static color for $TestCol, which is fine, you need the right color :) Should be -

Dec("F0F0F0")

tnx :), but I changed the bkcolor of the $drag_gui, and I tried:

$TestCol2 = DllCall($hGDI, "int", "GetPixel", "hwnd", $hDC, "int", 0, "int", 0)
ConsoleWrite(Hex($TestCol2[0], 6) & ", ")

and I got: FEF3ED

so I put that color in the trans func.

I'll look closer into this next time I upload the script (and that'll be once I make the main GUI resizeable)

Anyway I appreciate your support o:)

Link to comment
Share on other sites

Im not sure I understand. What should i do, for example, with this?

Func __GUICtrlRichEdit_LoadDLL()
    Switch @AutoItUnicode
        Case True
            $h_GUICtrlRTF_lib = DllCall("kernel32.dll", "hwnd", "LoadLibraryA", "str", "MSFTEDIT.DLL")
            If $h_GUICtrlRTF_lib[0] = 0 Then ContinueCase
            $_GRE_sRTFClassName = $RICHEDIT_CLASS50W
        Case False
            $h_GUICtrlRTF_lib = DllCall("kernel32.dll", "hwnd", "LoadLibraryA", "str", "RICHED20.DLL")
            If $h_GUICtrlRTF_lib[0] = 0 Then ContinueCase
            $_GRE_sRTFClassName = $RICHEDIT_CLASSA
            If @AutoItUnicode Then $_GRE_sRTFClassName = $RICHEDIT_CLASSW
        Case Else
            $h_GUICtrlRTF_lib = DllCall("kernel32.dll", "hwnd", "LoadLibraryA", "str", "RICHED32.DLL")
            If $h_GUICtrlRTF_lib[0] = 0 Then Exit 0 * MsgBox(32, @ScriptName & " - Error", "No RichEdit found. Exiting")
            $_GRE_sRTFClassName = $RICHEDIT_CLASS10A
    EndSwitch
EndFunc

they are undefinded

These functions are from my RichEdit UDF. There's also a version which do not include the macro, just download the UDF from the Link in my sugnature. The _BETA-file is without this macro :)

@sandin: please do not remove the Author lines when you copy UDFs. You can remove the description, but not the author.

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

and ability to add comments/descriptions to any of the treeview item according to titoproject's suggestion (post #12)

Very nice feature, but...it isn't what I meant!!!

When I said "the ability to comment keys and sections" I meant disable/enable keys and sections (by commenting the code).

Eg.: normal ini code:

[Section]
Key=Value

now I comment the key "key":

[Section]
; Key=Value

Sorry for not express myself clearly, anyway the "comment feature" as you've done is very useful too!!!

Link to comment
Share on other sites

@titoproject:

lolz! I misunderstood you, but if I didn't I wouldn't have made this feature for the script, so it turns out to be OK :)

@ProgAndy:

Sorry, I though of posting this script as an application ready for compiling, and gave you the credits in the 1st post, but I re-uploaded the script with author of richedit functions :o (I thought of putting everything into single Au3 file, that's why I had to copy udf from your RichEdit.Au3, sorry...)

Link to comment
Share on other sites

You can copy as much as you want, but it's better if you write the Author to each function... Otherwise someone likes the function copies it and then don't know who made it (esp. when there are questions)

and the editor is really great.

Possibly, you could use SciLexer instead of RichEdit, so sysntax highliting is available in Code window.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

You can copy as much as you want, but it's better if you write the Author to each function... Otherwise someone likes the function copies it and then don't know who made it (esp. when there are questions)

and the editor is really great.

Possibly, you could use SciLexer instead of RichEdit, so sysntax highliting is available in Code window.

I'm glad you like it :o And ya, I found a way to use simple (basic) edit control, and detect when user is typing something in it, so I changed it in the last update, and I gained less memory usage :)

Link to comment
Share on other sites

  • 3 months later...

Great program with nice clean gui, it really improves my workflow:D

[font="Impact"]Use the helpfile, It´s one of the best exlusive features of Autoit.[/font]http://support.microsoft.com/kb/q555375ALIBI Run - a replacement for the windows run promptPC Controller - an application for controlling other PCs[size="1"]Science flies us to the moon. Religion flies us into buildings.[/size][size="1"]http://bit.ly/cAMPZV[/size]
Link to comment
Share on other sites

for me it works:

WinXP, SP3

maybe you have different controls font, maybe you could change the treeview's font to Arial or some other that support your characters.

try opening this file:

Sorry, I was using an old DOS .ini file... not converted to Windows.

Ok, it works fine.

Thanks a lot.

Link to comment
Share on other sites

  • 3 weeks later...

Sorry my asking,

I want to create when I press on Add 1 Section (variable) with 2 key values (each time tte same)

Now I went through all the code , quit impressive, but a bit too overwelming for me...

Can somebody help me and say what I need to change to obtain this ??

Thanks

Link to comment
Share on other sites

well, have you ever seen INI file in which one key have two values?

if you wanna add 2 keys, click on any key in desired section, and press ADD button two times.

it works like this:

if you are on the 1st level (section), and you press ADD, you get new section, with one key, and one value

if you are on the 2nd level (key), and you press ADD, you get new key and it's value in the current section

if you are on the 3rd level (value), you can't press ADD since you can't add another value to the current key, you can only edit existing one.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

This application is meant for creating or editing INI files (which all programmers use for saving their program's data)

sandin, this is just outstanding work!

I want to use it as a module to be included in one of my autoit scripts, which already has a GUI. So I modified your source:

  • I added these AutoIt options, which i already use in my script

    Opt("GUIOnEventMode", 1)
    --> since there's already a main loop in my script, I created a new dedicated function fINIEditor_Create() for the creation of the INI Editor GUI and I reduced the While Loop such that it could be eliminated. This has been done by creating these additional functions: _GUI_EVENT_PRIMARYDOWN(), _GUI_EVENT_PRIMARYUP(), _GUI_EVENT_MOUSEMOVE, fSet_just_edited_g4inieditor() and fSet_saved_g4inieditor() and by tying functions to the buttons directly with GUICtrlSetOnEvent().

    Opt("MustDeclareVars", 1)
    --> some missing globals had to be defined
  • Then, since I include your script in mine, all globals and some functions received a suffix "_g4inieditor", i.e. "global for ini editor" because otherwise I got name clashes (too bad AutoIt doesn't know about namespaces).
  • fINIEditor_Create() also takes parameters in order to disable the "new" and "open" toolbar buttons. (Oops, while writing this I notice that I will have to disable the corresponding hotkeys and context menu items as well - work to be done.)
  • fINIEditor_Show() shows and activates the window, taking an INI filename as a parameter.
  • _exit() only hides the window.
  • As for the static hot keys, I included the library HotKey.au3 from Yashied. This makes it easy to have several AutoIt windows in the same script open and each with its own, possibly overlapping set of hotkeys. Otherwise it would have been necessary to tediously test on the active window in my main loop and switching the hotkey sets.
  • additional hotkeys that I defined:

    ALT+N = New

    ALT+O = Open

    ALT+S = Save

    ALT+T = Turbo mode

    ALT+X = Exit

  • I also commented out some unused statements.
The whole script still functions standalone as well. When including it into other scripts, only the "#Region Main" has to be deleted (see comments in the code).

sandin did some testing and gave me hints, thank you sandin.

How I got it flicker free: switching the extended window style to $WS_EX_COMPOSITED during the resize operation.

The Editor still contains some shortcomings of the original version, e.g. the description for keys with the same name get mixed up, but nevertheless it's already very usable.

Ini_Editor.ema.zip

Edited by onderhold
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...