 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Drugwash
Joined: 07 Sep 2008 Posts: 921 Location: Ploiesti, RO
|
Posted: Tue Sep 01, 2009 9:49 am Post subject: |
|
|
| Raccoon wrote: | Drugwash,
Please tell me more about this script you've authored for Smart GUI. To what extent does it modify Rajat's original application, and such? Do you have a version history or other documentation I could review? | I did not keep a changelog for this script (my bad, I admit) but I do keep intermediary versions of the script.
As to the extent of the changes, they were initially meant to replace the mouse hotkeys that wouldn't work in Win9x (since I'm only using 98SE) but only when running under Win9x (through the w9x variable), then I started fiddling with the appearance of certain dialogs and finally attempted to enhance the font settings as well as the custom parameters.
After more testing I did find a few new bugs but as I mentioned previously, I'll be unable to work on SmartGUI (or any other computer-related stuff) for at least one or two months.
Any additions/corrections are welcome in the mean time and hopefully I'll be able to put them all in a new version, at some point. |
|
| Back to top |
|
 |
-michael- Guest
|
Posted: Thu Sep 24, 2009 9:35 pm Post subject: rajat ? |
|
|
is rajat still kicking around ? have not seen his nick for a while hope so he has a lot of good code in skills i remember years ago he gave us the SmartGUI and chris have not seen his nick in a while i remember in 04 when i was trying to be a programer and i say trying lol i was lost. it all look so hard to me then i found ahk his work on ahk made it easy for others like me to learn Today i use 5 dif languages thank you ahk took me into the world of scripting and programming .
mike |
|
| Back to top |
|
 |
Kasper
Joined: 01 Dec 2009 Posts: 2
|
Posted: Tue Dec 01, 2009 11:49 pm Post subject: |
|
|
| sguiHelper wrote: | | ecksphore wrote: | Will this application ever have the Menu feature built in to it?
It's frustrating building a nice GUI only to add a menu in and everything gets misaligned. |
You can use sgui to build your gui with everything execpt the main menu, then convert the gui code to use relative coords. Then you can easily add the menu element.
| Code: | title Abs2Rel v3 - Absolute to Relative coordinates fix for SGUI
source post http://www.autohotkey.com/forum/post-71874.html#71874
in thread http://www.autohotkey.com/forum/topic11722.html
code link http://autohotkey.net/~aikscroll/Abs2Rel.ahk
|
|
Semi-necro~
The Abs2Rel source from the code link is nearly completely broken. Seems almost like most of the function is broken. Also, aikscroll's site is gone so I can't even get the original source from there. Any ideas? I'm trying to figure out how to even add a gui menu and right now, between using examples that don't work in the documentations and searching all over the forum, it's getting frustrating. Was hoping I would find something like this and sure enough when I did, it's broken.  |
|
| Back to top |
|
 |
ruespe
Joined: 17 Jun 2008 Posts: 243
|
Posted: Sat Dec 05, 2009 11:15 am Post subject: |
|
|
Shit. The code-tags didn't work. And it's the wrong script. I shouldn't post at weekends.
New try. Perhaps someone can delete the prev post.
[ Moderator!: Done! ]
---------------------------------
Here is the sourcecode. I corrected some mistakes of the original version. For me it's working. And it's great.
| Code: |
/*
Abs2Rel v3
by aikscroll
www.mevets.com
*/
test =
(
Gui, Add, Button, x6 y10 w80 h30 , Button
Gui, Add, CheckBox, x6 y50 w110 h30 , CheckBox
Gui, Add, Radio, x56 y100 w100 h30 , Radio
Gui, Add, Text, x6 y100 w40 h30 , Text
Gui, Add, GroupBox, x126 y10 w90 h70 , GroupBox
Gui, Add, Picture, x136 y30 w20 h20 , C:\Documents and Settings\Owner\Desktop\UI\tab.gif
Gui, Add, DropDownList, x226 y20 w100 h20 , DropDownList
Gui, 2:Add, ComboBox, x226 y50 w100 h20 , ComboBox
Gui, 2:Add, ListBox, x166 y90 w100 h30 , ListBox
Gui, 3:Add, ListView, x336 y10 w130 h60 , ListView
Gui, 3:Add, DateTime, x6 y140 w100 h30 ,
Gui, 3:Add, MonthCal, x276 y80 w190 h160 ,
Gui, 3:Add, Progress, x116 y140 w90 h20 , 25
Gui, 3:Add, Slider, x6 y180 w100 h30 , 25
Gui, 3:Add, Hotkey, x116 y170 w100 h20 ,
Gui, 3:Add, Tab, x6 y250 w460 h120 , Tab1|Tab2
; Generated using SmartGUI Creator 4.0
Gui, Show, x130 y91 h377 w477, New GUI Window
Gui, 2:Show, x125 y81 h377 w477, New GUI Window
Gui, 3:Show, x100 y81 h377 w477, New GUI Window
Return
GuiClose:
ExitApp
Return
)
Gui, Add, Text, , Paste your Gui code, as generated by Rajat's SGUI, below and then press 'Fix'.
Gui, Add, Edit, w400 h200 xp+0 yp+25 vtxtSource gSource, %Clipboard%
Gui, Add, Button, xp+0 yp+210 vbtnShow gShow, Show me a typical script
Gui, Add, Button, w100 xp+300 yp+0 vbtnFix gFix, Fix
Gui, Show, , Abs2Rel v3
Return
Fix:
Gui, Submit, NoHide
txtSource := abs2rel(txtSource)
GuiControl, , txtSource, %txtSource%
clipboard = %txtsource%
Return
Show:
GuiControl, , txtSource, %test%
Return
Source:
Return
GuiClose:
ExitApp
Return
abs2rel(txtsource) {
Loop, parse, allCounts, `,
{
storeXs%A_Index% =
storeYs%A_Index% =
}
allCounts =
coordX =
coordY =
Loop, Parse, txtSource, `n
{
StringReplace, noGui, A_LoopField, Gui`,%A_Space%
StringMid, GuiCountNum, noGui, 1, 1
StringMid, GuiCountColon, noGui, 2, 1
If GuiCountNum is Number
{
If (GuiCountColon = ":")
{
StringTrimLeft, noGui, noGui, 2
GuiCount = %GuiCountNum%
}
}
Else
GuiCount = 1
StringMid, strShow, noGui, 1, 4
StringReplace, noGuiAdd, noGui, Add`,
findComma := InStr(noGuiAdd, "`,")
findComma++
StringMid, noCtype, noGuiAdd, %findComma%
;get x
coordX =
findX := InStr(noCtype, "x")
Loop
{
findX++
StringMid, num, noCtype, %findX%, 1
If num is Number
coordX = %coordX%%num%
Else
{
If coordX is Number ;notice: coordX not num
{
If (strShow <> "Show")
{
storeXs%GuiCount% := storeXs%GuiCount% . "`n" . coordX
If GuiCount not in %allCounts%
allCounts = %allCounts%,%GuiCount%
}
}
Break
}
}
;get y
coordY =
findY := InStr(noCtype, "y")
Loop
{
findY++
StringMid, num, noCtype, %findY%, 1
If num is Number
coordY = %coordY%%num%
Else
{
If coordY is Number
{
If strShow <> "Show")
storeYs%GuiCount% := storeYs%GuiCount% . "`n" . coordY
}
Break
}
}
}
StringTrimLeft, allCounts, allCounts, 1
Loop, Parse, allCounts, `,
{
StringTrimLeft, storeXs%A_Loopfield%, storeXs%A_Loopfield%, 1
StringTrimLeft, storeYs%A_Loopfield%, storeYs%A_Loopfield%, 1
StringSplit, arrXs%A_Loopfield%, storeXs%A_Loopfield%, `n
StringSplit, arrYs%A_Loopfield%, storeYs%A_Loopfield%, `n
Loop, % arrXs%A_Loopfield%0
{
next := A_Index + 1
diffX := arrXs%A_Loopfield%%next% - arrXs%A_Loopfield%%A_Index%
diffY := arrYs%A_Loopfield%%next% - arrYs%A_Loopfield%%A_Index%
If diffX >= 0
diffX = +%diffX%
If diffY >= 0
diffY = +%diffY%
txtX := arrXs%A_Loopfield%%next%
txtY := arrYs%A_Loopfield%%next%
txtSearch := "x" . txtX . A_Space . "y" . txtY
txtRep := "xp" . diffX . A_Space . "yp" . diffY
StringReplace, txtSource, txtSource, %txtSearch%, %txtRep%
}
}
Return txtSource
}
|
_________________ Greetings
Rog |
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 1002 Location: Germany - Deutschland
|
Posted: Tue Dec 08, 2009 11:21 am Post subject: |
|
|
Really cool, thanx ruespe!
Could you please change one thing? xp+0 should be just xp, yp+0 should be yp etc.
Thanks. |
|
| Back to top |
|
 |
ruespe
Joined: 17 Jun 2008 Posts: 243
|
Posted: Tue Dec 08, 2009 2:27 pm Post subject: |
|
|
Thanks!
| aaffe wrote: | Really cool, thanx ruespe!
Could you please change one thing? xp+0 should be just xp, yp+0 should be yp etc.
Thanks. | Why? It doesn't disturb me. And it's not my code. I only made it working. And I don't have the time right now to analyse the code to change this. Sorry.
What I'm missing much more is
- clustering of the Gui-elements, so that for example all elements of a groupbox are side-by-side
- using the section- and the xs/ys-options for groupboxes
- sorting of the GUI-elements _________________ Greetings
Rog |
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 1002 Location: Germany - Deutschland
|
Posted: Tue Dec 08, 2009 2:54 pm Post subject: |
|
|
No problem, I thought it was your code original.
xp+0 etc. only doesnt look very nice. it makes the code a bit unreadable... |
|
| Back to top |
|
 |
fasto
Joined: 22 May 2009 Posts: 12
|
Posted: Sun Dec 13, 2009 3:33 am Post subject: better way for moving controls |
|
|
try this. You will like it.
you can just paste this into guixp mod 4.2.
when you select the move control menu, now it doesn't break the control's original position and if you only want to resize, not to move the control, just click and it will automatically go into resizing mode.
| Code: |
ChangeLabel:
IniRead, OLabel, %Temp%\SGUIControls.ini, %CtrlNameCount%, Label
StringReplace, OLabel, OLabel, ```,, `,, A
StringReplace, OLabel, OLabel, ````, ``, A
StringReplace, OLabel, OLabel, ```%, `%, A
gui, +OwnDialogs ; <--- added to guixp mod 4.2
InputBox, CtrlText, Label, Enter Control Label,, 250, 125,,,,,%OLabel%
IfEqual, ErrorLevel, 1, Return
StringReplace, TmpCtrlText, CtrlText, ``n, `n, A
;replacing earlier contents of ctrl label
If CtrlNameCount Contains SysTabControl,ListBox,ComBoBox
GuiControl, 1:, %CtrlNameCount%, |%TmpCtrlText%
Else
GuiControl, 1:, %CtrlNameCount%, %TmpCtrlText%
Gosub, FixText
;leading pipe removed from controltext
;this pipe is added to control labels to clear previous contents
;eg. for listbox and tabs
StringLeft, Test, CtrlText, 1
IfEqual, Test, |, StringTrimLeft, CtrlText, CtrlText, 1
IniWrite, %CtrlText%, %Temp%\SGUIControls.ini, %CtrlNameCount%, Label
Return
Modify:
ControlGetPos, cX, cY,,, %CtrlNameCount%, ahk_id %MainWndID%
IniRead, Ctrl2Add, %Temp%\SGUIControls.ini, %CtrlNameCount%, Name
IniRead, CtrlText, %Temp%\SGUIControls.ini, %CtrlNameCount%, Label
If Ctrl2Add Not In Button,Checkbox,ComboBox,DateTime,DropDownList,Edit,GroupBox,ListBox,ListView,MonthCal,Progress,Picture,Radio,Slider,Tab,Text,UpDown,Hotkey
Return
;get CtrlName & CtrlCount
Loop
{
StringRight, check, CtrlNameCount, %a_index%
if check is integer
{
CtrlCount = %check%
StringTrimRight, CtrlName, CtrlNameCount, %a_index%
}
Else Break
}
;here we get Ctrl2Add (ahk name)
IniRead, Ctrl2Add, %Temp%\SGUIControls.ini, %CtrlNameCount%, Name
;Here we get correct Ctrl text after modification
IniRead, CtrlText, %Temp%\SGUIControls.ini, %CtrlNameCount%, Label
ControlGetPos, cx, cY,,, %CtrlNameCount%, ahk_id %MainWndID% ; <--- added to guixp mod 4.2
mousemove, %cx%, %cy%, 0 ; <--- added to guixp mod 4.2
Goto, Alter
return
|
|
|
| Back to top |
|
 |
aaffe
Joined: 17 May 2007 Posts: 1002 Location: Germany - Deutschland
|
Posted: Mon Dec 14, 2009 8:38 am Post subject: |
|
|
| Edit: Ok, found it. |
|
| Back to top |
|
 |
bitcloud
Joined: 30 Oct 2008 Posts: 27
|
Posted: Thu Feb 04, 2010 5:16 am Post subject: |
|
|
This is just fanboy mail here.
nothing to add... other than than *holy shit, nice work man!*
thanks so much for your time on this! |
|
| Back to top |
|
 |
XYZ
Joined: 20 Mar 2010 Posts: 224
|
Posted: Sun Mar 21, 2010 12:43 pm Post subject: |
|
|
amazing
thx
in the past i had real trouble in positioning
but now its gone
Last edited by XYZ on Tue Mar 30, 2010 5:51 am; edited 1 time in total |
|
| Back to top |
|
 |
random11
Joined: 10 Dec 2008 Posts: 97
|
Posted: Thu Mar 25, 2010 8:24 pm Post subject: smart gui |
|
|
| make it work with menu tool bar buttons... also a text box would be nice... instead of one line of text with the "text" control |
|
| Back to top |
|
 |
Drugwash
Joined: 07 Sep 2008 Posts: 921 Location: Ploiesti, RO
|
Posted: Fri Mar 26, 2010 2:08 pm Post subject: |
|
|
At some point I intend to add Menu and Rebar as well as other missing features, but for now existing bugs should be squashed. However, since my Internet access is still sporadic, can't get the desired info so work on this script (and others) is very slow. Not to mention the other real-life issues.
In the mean time, any contribution is appreciated and will be considered for an upcoming version.
P.S. I'm not sure what you mean by "text box"... Could you please elaborate? |
|
| Back to top |
|
 |
random11
Joined: 10 Dec 2008 Posts: 97
|
Posted: Fri Mar 26, 2010 11:30 pm Post subject: |
|
|
| Drugwash wrote: |
P.S. I'm not sure what you mean by "text box"... Could you please elaborate? |
In stead of only letting you put in one line of text. Like the Text control, make a text box. where you can put multiple lines of text.
normally you would have to type it out in one big long string and put (`n) where you wanted a new line. |
|
| Back to top |
|
 |
Drugwash
Joined: 07 Sep 2008 Posts: 921 Location: Ploiesti, RO
|
Posted: Fri Apr 02, 2010 8:57 pm Post subject: |
|
|
This can be solved thorugh an Edit control, eventually with certain specific parameters that can make it look like a regular text control. +Wrap usually helps.
On a general note: I'm currently working on adding Menu to the controls, but a little issue stops me from finishing it. I'll be posting it here as soon as I manage to work around it. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|