Jump to content



Photo

Ini Editor


  • Please log in to reply
54 replies to this topic

#1 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 13 December 2008 - 11:30 PM

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

Posted Image Posted Image Posted Image

You can add items (sections, keys, values), edit items, delete items, search for items or even drag items
Adding items is very simple, if your current selected item is Section, then if you click ADD, you'll add section with 1 key and it's value, If you click ADD while your current selection is any key, then you'll add a key with it's value in the same section where your selected key is.
Editing item's txt can be done with ENTER or F2 key (you can cancel with ESC while you're in "edit" mode)
Deleting items can be done with key DEL
You probably thinking "why did he used new child to set key's value it's annoying to expand every key to check/edit it's value", well if you turn TURBO mode on, then if you click ENTER while key item is selected, you go straight to edit it's value. And btw, I used new child to set as key's value so it could be easier to browse between keys and once you select Key or Value, bottom input will display the value, so you don't have to expand KEY if you wanna check it's value.
You can create AU3 code by clicking bottom button "Generate AU3 Code" which will generate writing of your INI file, or you can go Right Click on any item and select whether Write or Read code, and by that, application will generate AU3 code for writing or reading that key or value which is selected.

hotkeys:
CTRL+N = New
CTRL+O = Open
CTRL+S = Save
CTRL+SHIFT+S = Save As
CTRL+F = Find
ALT+A = Add item
Application Key (Next to Windows key) = call "right click menu" on treeview

I hope you'll like it and use it :)
Please report any bugs if you find.

Edit reason: fixed bug according to post #17 (thank you wraithdu) and added resizeable gui support according to wraithdu's suggestion (post #14) :)
Edit 2: Added ability to create descriptions for any of the items in the treeview according to titoproject's suggestion (post #12)
Edit 3: Fixed bug with "description of items", and reduced memory usage

Attached Files


Edited by sandin, 09 July 2009 - 05:04 PM.








#2 Touch

Touch

    Wayfarer

  • Active Members
  • Pip
  • 71 posts

Posted 14 December 2008 - 12:33 AM

JamesBrooks made something called InsideNI which displays INI files in a tree just like this.

If practise makes perfect and no-ones perfect whats the point of practise?Sorry for my rude attitude when I started here.


#3 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 14 December 2008 - 12:38 AM

JamesBrooks made something called InsideNI which displays INI files in a tree just like this.

oh, I wasn't aware... well anyway it's better to have more applications with same purpose than none :)

#4 Touch

Touch

    Wayfarer

  • Active Members
  • Pip
  • 71 posts

Posted 14 December 2008 - 12:42 AM

His didn't write anything. Not sure if he even finished it.

If practise makes perfect and no-ones perfect whats the point of practise?Sorry for my rude attitude when I started here.


#5 TehWhale

TehWhale

    Whalee..

  • Banned (NOT IN USE)
  • 1,482 posts

Posted 14 December 2008 - 01:13 AM

My first thought was this is going to be some simple stupid application. Then I saw "Sandin" as the thread creator, and I thought: "Dude this must be really advanced if he made it". Going to test it out now!

Edited by TehWhale, 14 December 2008 - 01:47 AM.


#6 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 14 December 2008 - 01:28 AM

My first thought was this is going to be some simple stupid application. Then I saw "Sandin" as the thread creator, and I thought: "Dude this must be really advanced if he made it". Going to test it out now!

lolz!! :) I hope you'll like it :)

#7 TehWhale

TehWhale

    Whalee..

  • Banned (NOT IN USE)
  • 1,482 posts

Posted 14 December 2008 - 01:47 AM

lolz!! :) I hope you'll like it :)

I do! It's very good.

#8 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 14 December 2008 - 02:02 AM

I'm glad you do, creating ini files is not very hard even without a program, but if you need lots and lots and LOTS of data retrieved/written from/to an ini file, you could use an advanced application for the job, that was my case, so I made this tool :)

btw, main file replaced (fixed some dragging bugs - you can't move key if it's the only one in the section any more)

Edited by sandin, 14 December 2008 - 02:03 AM.


#9 Calistoga

Calistoga

    Seeker

  • Active Members
  • 48 posts

Posted 14 December 2008 - 02:24 PM

Very nice work sandin, as always :)

#10 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 14 December 2008 - 04:56 PM

Very nice work sandin, as always :)

Thank you! :)
still have one thing I need to fix: When u add new item in turbo mode, the one selected (it's not the one you're adding) will collapse, this needs to be fixed, but I'll do it later, dun have time right now.

#11 TheSaint

TheSaint

    *** Knight Templar ***

  • MVPs
  • 4,294 posts

Posted 14 December 2008 - 05:47 PM

Thanks for sharing! :)

Make sure brain is in gear before opening mouth! Ignoring those who try to divert conversation with irrelevancies. If I put effort into communication, I expect you to read properly & fully, or just not comment. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox


#12 tittoproject

tittoproject

    Seeker

  • Active Members
  • 35 posts

Posted 14 December 2008 - 07:53 PM

Very very nice!!!

I've just a feature to suggest: the ability to comment keys and section. It could be useful.

#13 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 15 December 2008 - 12:32 AM

Tnx @ both
@ tittoproject: well, I'll try, though, it'll be hard to implement into ini file, and read info from it without interfering with the ini file structure, but I'll give it a try.
btw, script updated, fixed bug from post #10

#14 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,140 posts

Posted 15 December 2008 - 02:51 AM

Really nice script! Very well done.

I've got one request and one bug with your latest update. Would it be possible to allow your GUI to be resized? I know there's a ton of controls in there, so if it's a crazy amount of work, don't sweat it. Also, just a FYI, the @AutoItUnicode macro is gone in the 3.2.13.x betas, so I have to remove them to compile (no big deal either).

So the bug...I have a rogue icon when starting the app for about 5 seconds or so, then it disappears. In the screenshot I moved the GUI out of the way so you can see the icon, which means it's not part of the GUI somehow. This is new with the latest update.

EDIT - I also noticed the GUI is unresponsive (can't click buttons, exit, etc.) for those 5 seconds until the icon disappears.

Edited by wraithdu, 15 December 2008 - 02:57 AM.


#15 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,140 posts

Posted 15 December 2008 - 03:07 AM

Ok, this happened with the first version also, I checked again. It has to do with the setTrans() function and Vista. PixelGetColor takes a CRAZY long time in Vista. It has something to do with the GetDC portion of the function, which it does each time it is called. I think you can get around this by calling the GetPixel function directly. I'll try to get you an fixed function (I had to do this before with the stereograms example some posted a while back).

#16 billthecreator

billthecreator

    I am The creator

  • Active Members
  • PipPipPipPipPipPip
  • 379 posts

Posted 15 December 2008 - 03:13 AM

what can i do to fix the @AutoItUnicode problem. it says i dont have the macro
My Scripts: From Most recent to least.Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

#17 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,140 posts

Posted 15 December 2008 - 03:31 AM

@billthecreator
Remove the references to it, and follow the code logic as if that macro is TRUE, because it is. It was removed from the 3.2.13.x betas because AutoIt is now Unicode only.

@sandin
This will fix the problem. BTW, I noticed in that function that you have a DllStruct that is never used, and had a type error in it 'inr' instead of 'int'. So I commented it out anyway. This should make your transparency work as expected. In your original, you were doing PixelGetColor() on the whole screen I believe (no specified window hwnd). This version fixes the performance problem in Vista, and specifies the $drag_gui, which I think is what you wanted anyway.

AutoIt         
Func setTrans()     Local $hGDI = DllOpen("gdi32.dll"), $color         Local $hDC = _WinAPI_GetDC($drag_gui)     $aM_Mask = DllCall($hGDI, "long", "CreateRectRgn", "long", 0, "long", 0, "long", $gw + 1, "long", $gh + 1) ;~     $rct = DllStructCreate("int;int;int;int", $aM_Mask[0])     $TestCol = DllCall($hGDI, "int", "GetPixel", "hwnd", $hDC, "int", 0, "int", 0)     $Startx = -1     $Starty = -1     $Endx = 0     $Endy = 0     For $i = 0 To $gw         For $j = 0 To $gh             $color = DllCall($hGDI, "int", "GetPixel", "hwnd", $hDC, "int", $i, "int", $j)             If $color[0] = $TestCol[0] And $j < $gh Then                 If $Startx = -1 Then                     $Startx = $i                     $Starty = $j                     $Endx = $i                     $Endy = $j                 Else                     $Endx = $i                     $Endy = $j                 EndIf             Else                 If $Startx <> -1 Then addRegion()                 $Startx = -1                 $Starty = -1             EndIf         Next     Next     DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $drag_gui, "long", $aM_Mask[0], "int", 1)     _WinAPI_ReleaseDC($drag_gui, $hDC)     DllClose($hGDI) EndFunc

Edited by wraithdu, 15 December 2008 - 04:29 AM.


#18 billthecreator

billthecreator

    I am The creator

  • Active Members
  • PipPipPipPipPipPip
  • 379 posts

Posted 15 December 2008 - 03:34 AM

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ƒo݊÷ Ù©Ýj[(НzÜ(¢Ø^®šènW¦±«­¢+Ù}U% Ñɱ  ÕÑѽ¹}M•Ñ%µ…•1¥ÍÐ ¤)}]¥¹A%} …±±]¥¹‘½ÝAɽŒ

they are undefinded

Edited by billthecreator, 15 December 2008 - 03:36 AM.

My Scripts: From Most recent to least.Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

#19 sandin

sandin

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 569 posts

Posted 15 December 2008 - 01:32 PM

@wraithdu:
thank you for your help, I've uploaded the script according to your settrans func. :)
I tried to make it resizable, but I ran into a prob. (treeview wasn't stretching, and neither was richedit - search input), though I'll try again :)

@billthecreator
try running the script with latest redistributable version (not beta) until I make it work for the beta.

#20 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,140 posts

Posted 15 December 2008 - 03:52 PM

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")




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users