Jump to content


Photo

Animated Image Gui with no images and only 55kb.


  • Please log in to reply
12 replies to this topic

#1 specter333

specter333
  • Members
  • 606 posts

Posted 04 August 2011 - 08:14 PM

This was one of those proof of concept projects but not very practical. With over 80 gui windows it would have been much easier to use images for the controls. However this project does demonstrate the "WinSet, Region" command and shows how a complex gui can be built without the use of images.

The "No image, image gui" make excessive use of the Dock A function library and the Tips and Tricks post.

Oops, forgot to mention this script uses the LCARS font which can be downloaded for free from x32.com. If you like the LCARS interface you should check out the LCARS shell at www.lcarsx32.com

All In One, I've combined all six scripts into one for easier download. I believe the only other script needed is Dock_A. I put the command page last so you can scroll to the bottom of the script and add subroutines. Edit: I have added instructions and notes in the AIO script.

For ease and readability I wrote this with 5 separate include files. Edit: More notes added to scripts.
No Image - Image Gui, main file.
Inc Commands.ahk, add glabels to the bottom of this script.
Inc ButtonClass.ahk, definitions for creating controls.
Inc P1 Buttons.ahk, The layout for page 1.
Inc P2 Buttons.ahk, The layout for page 2.
Inc Audio Controls.ahk, The layout for page 3.
Posted Image

No Image - Image Gui Video
Here is a screen capture which somewhat shows the animation. For some reason the buttons that had been clicked disappear in the video but not in the script. The video is rough and the 6 scripts are a fraction of the video size so I suggest downloading and trying to scripts instead.

I have not assigned commands to many of the controls. To add commands add a g-label to the bottom of the Inc Commands script. The label will be the the term "Area" and the gui number which is displayed in the left bar whenever a gui is clicked. Every button also has text that can be used. It's associated variable is "Text" and the gui number. Example,
Area51:
WinSet, Transparent, 255, Area51
GuiControl, 23:, Text23, NewText
Return
Buttons without a g-label still dim when clicked but return on mouse up. Buttons with labels dim when clicked but the return must be set in the subroutine if desired.

To make a button non-dim add the gui number to the "DoNotTrans" list at the top of the Inc Commands script. All button/gui windows can be a control simply by adding a subroutine. Dimming buttons activate on mouse up so you can drag the mouse off without activating the subroutine. Non-dim buttons activate on mouse down for use such as dragging the window.

This was a learning project so I'm sure much of it could have been done simpler and with less code. It's written in AHK basic.

Edit:
Drugwash has some excellent suggestions to improve this script. They can be found a few post down.

#2 Guests

  • Guests

Posted 04 August 2011 - 08:25 PM

Could you make screenshots...or a video of this?

#3 SoggyDog

SoggyDog
  • Members
  • 803 posts

Posted 04 August 2011 - 09:12 PM

Could you make screenshots...or a video of this?

+1

#4 specter333

specter333
  • Members
  • 606 posts

Posted 05 August 2011 - 01:33 AM

Could you make screenshots...or a video of this?


Screen shot, video and single file download added to original post.

#5 fred

fred
  • Members
  • 257 posts

Posted 05 August 2011 - 01:44 AM

Nice LCARS interface :)

#6 specter333

specter333
  • Members
  • 606 posts

Posted 05 August 2011 - 02:37 AM

Nice LCARS interface :)

Thanks, I figured for trying to form shapes with the winset command this would be an easy subject.

#7 specter333

specter333
  • Members
  • 606 posts

Posted 05 August 2011 - 02:48 PM

Last edit... I hope.

Added instructions to the "All In One" script and notes to all the scripts. Cleaned and organized the scripts a little better, mostly the aio script.

The "All In One" script is the only one needed. It contains the main script and the five included script. Dock_A is still needed for use.

To make subroutines, add G-Labels to the bottom of the aio script.
To make gui/controls non-dim when clicked add the gui number to line 1400.

That is all the necessary changes but customizing the pages can be done with the instructions at the top of the "All In One" script.

#8 nimda

nimda
  • Members
  • 4301 posts

Posted 05 August 2011 - 03:40 PM

Using WM_NCLButtonDown we can make the Gui draggable

#9 specter333

specter333
  • Members
  • 606 posts

Posted 06 August 2011 - 12:32 AM

Using WM_NCLButtonDown we can make the Gui draggable


I opted to make a drag button instead of dragging anywhere, just thought it would look like I put more thought into it.

#10 Drugwash

Drugwash
  • Members
  • 1048 posts

Posted 06 August 2011 - 07:23 PM

Interesting concept, however quite slow, especially on an older system such as mine (667MHz Pentium III). A few considerations:
• to improve speed, add the following directives at the top:
SetControlDelay, -1
SetWinDelay, -1
SetBatchLines, -1

• please mention the requirement of an extra font for this script (LCARS.ttf)
A_Language is inaccurate since it reads the OS language, not the regional settings; to correct this, you may use the following function which is part of a small library I developed for help in using translations:
_FindLang(lang="")
{
Static lstr := "0436=Afrikaans,041c=Albanian,0401=Arabic Saudi Arabia,0801=Arabic Iraq,0c01=Arabic Egypt,1001=Arabic Libya,1401=Arabic Algeria,1801=Arabic Morocco,1c01=Arabic Tunisia,2001=Arabic Oman,2401=Arabic Yemen,2801=Arabic Syria,2c01=Arabic Jordan,3001=Arabic Lebanon,3401=Arabic Kuwait,3801=Arabic UAE,3c01=Arabic Bahrain,4001=Arabic Qatar,042b=Armenian,042c=Azeri Latin,082c=Azeri Cyrillic,042d=Basque,0423=Belarusian,0402=Bulgarian,0403=Catalan,0404=Chinese Taiwan,0804=Chinese PRC,0c04=Chinese Hong Kong,1004=Chinese Singapore,1404=Chinese Macau,041a=Croatian,0405=Czech,0406=Danish,0413=Dutch Standard,0813=Dutch Belgian,0409=English US,0809=English UK,0c09=English Australian,1009=English Canadian,1409=English New Zealand,1809=English Irish,1c09=English South Africa,2009=English Jamaica,2409=English Caribbean,2809=English Belize,2c09=English Trinidad,3009=English Zimbabwe,3409=English Philippines,0425=Estonian,0438=Faeroese,0429=Farsi,040b=Finnish,040c=French Standard,080c=French Belgian,0c0c=French Canadian,100c=French Swiss,140c=French Luxembourg,180c=French Monaco,0437=Georgian,0407=German Standard,0807=German Swiss,0c07=German Austrian,1007=German Luxembourg,1407=German Liechtenstein,0408=Greek,040d=Hebrew,0439=Hindi,040e=Hungarian,040f=Icelandic,0421=Indonesian,0410=Italian Standard,0810=Italian Swiss,0411=Japanese,043f=Kazakh,0457=Konkani,0412=Korean,0426=Latvian,0427=Lithuanian,042f=Macedonian,043e=Malay Malaysia,083e=Malay Brunei Darussalam,044e=Marathi,0414=Norwegian Bokmal,0814=Norwegian Nynorsk,0415=Polish,0416=Portuguese Brazilian,0816=Portuguese Standard,0418=Romanian,0419=Russian,044f=Sanskrit,081a=Serbian Latin,0c1a=Serbian Cyrillic,041b=Slovak,0424=Slovenian,040a=Spanish Traditional Sort,080a=Spanish Mexican,0c0a=Spanish Modern Sort,100a=Spanish Guatemala,140a=Spanish Costa Rica,180a=Spanish Panama,1c0a=Spanish Dominican Republic,200a=Spanish Venezuela,240a=Spanish Colombia,280a=Spanish Peru,2c0a=Spanish Argentina,300a=Spanish Ecuador,340a=Spanish Chile,380a=Spanish Uruguay,3c0a=Spanish Paraguay,400a=Spanish Bolivia,440a=Spanish El Salvador,480a=Spanish Honduras,4c0a=Spanish Nicaragua,500a=Spanish Puerto Rico,0441=Swahili,041d=Swedish,081d=Swedish Finland,0449=Tamil,0444=Tatar,041e=Thai,041f=Turkish,0422=Ukrainian,0420=Urdu,0443=Uzbek Latin,0843=Uzbek Cyrillic,042a=Vietnamese"
if !lang
	{
	RegRead, lang, HKCU, Control Panel\International, Locale
	StringTrimLeft, lang, lang, 4
	}
if (i := InStr(lstr, lang))
	return SubStr(lstr, i+5, InStr(lstr, ",", false, i)-i-5)
}
• some mouse hover effects (hilighting) would be welcome

Otherwise, nicely done! 8)

#11 specter333

specter333
  • Members
  • 606 posts

Posted 06 August 2011 - 11:43 PM

Thank you. I made a link from my post to this one if anyone wants to implement your suggestions. But this was something I just wanted to see if I could do and I don't think anybody will actually being using it since it is slow and not very practical.

The A_Language call and all the other info is just there because I couldn't think of anything else to put on that page. I also find the screen resolution doesn't work correctly on this tablet and extra monitor I use on the weekends although it works on the computer I wrote this on, probably my math.


The really surprising and kinda depressing thing is this runs and drags better on this 1.2 tablet than it does on the 2.6 quad core I wrote it on.

Thanks again for the suggestions.

#12 garry

garry
  • Members
  • 2596 posts

Posted 07 August 2011 - 05:26 PM

looks very nice, just idea, use a_variables ( a_windir / a_programfiles )
SoundPlay, %a_windir%\Media\Windows XP Logon Sound.wav
Run, %A_programfiles%\Mozilla Firefox\firefox.exe


#13 specter333

specter333
  • Members
  • 606 posts

Posted 08 August 2011 - 04:52 AM

looks very nice, just idea, use a_variables ( a_windir / a_programfiles )


Cool, learned something new. I've learned a few new things between this and Drugwash's post.

Thanks