AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Show animated Gifs in your GUI
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
PhiLho



Joined: 27 Dec 2005
Posts: 6702
Location: France (near Paris)

PostPosted: Wed May 16, 2007 5:54 pm    Post subject: Reply with quote

Mmm, I corrected the problem before seeing your last message, I had to destroy the window (and just in case, unload the Gif) before freeing the DLL.
Well, I leave the code as an example.
And I changed the function names... Smile
Upload will follow soon.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Wed May 16, 2007 5:59 pm    Post subject: Reply with quote

Still not good. You can't expect that your include will be the only one in the script. Its autorun section in many real time scenarios will never be executed.

But thx for the effort Smile
_________________
Back to top
View user's profile Send private message MSN Messenger
PhiLho



Joined: 27 Dec 2005
Posts: 6702
Location: France (near Paris)

PostPosted: Wed May 16, 2007 6:12 pm    Post subject: Reply with quote

If user blindly includes a file ending the autorun section before including my file:
1) He is looking for trouble;
2) The include file isn't well designed.
Very Happy
OK, I might add AniGif_InitLibrary() and AniGif_FreeLibrary() functions, although I am a bit reluctant to set global variables in a function. Having better encapsulation would be indeed needed...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Wed May 16, 2007 6:16 pm    Post subject: Reply with quote

Well, include file is not include if I have to change it and look what I have to move. Imagine I want to use 5 your wrappers in my script. I will lost an hour fixing garbage around instead to just use the control. Plus, if I do that, you will undo my work in next version of your script.

If you just think about it, and stop complaining, you will clearly see I am not the witch.

In this case, control is having small number of messages, they all can be put as statics in appropriate functions. The drawback is that user will not have global styles/msgs available for included functionalities but that is the same as with AHK internal controls. The good side is invisibility to the outer world.

Init() function is as such more desirable. Doing it in Add/CreateControl function is probably the best choice in which case only Add/CreateControl stays without globals:
Code:
Add(..)
static init=false

if !init
    Control_Init() ;set globals


Quote:
Having better encapsulation would be indeed needed...

Something I scream about all the time, without any success.
_________________


Last edited by majkinetor on Wed May 16, 2007 6:46 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Wed May 16, 2007 6:31 pm    Post subject: Reply with quote

Great work. I've added it to the documentation for picture controls:
Quote:
Animated GIFs: Although animated GIF files can be displayed in a picture control, they will not actually be animated. To solve this, use the AniGIF DLL (which is free for non-commercial use) as demonstrated at http://www.autohotkey.com/forum/topic19264.html
Back to top
View user's profile Send private message Send e-mail
PhiLho



Joined: 27 Dec 2005
Posts: 6702
Location: France (near Paris)

PostPosted: Thu May 17, 2007 12:03 pm    Post subject: Reply with quote

Thanks.
I have made it now totally function wrapped, and the DLL is automatically loaded once, on first control creation. Styles specific to AniGif are given as strings and internally converted.
majkinetor, the problem isn't that your ideas are not good, it is in the way they are presented... Smile
There is still the demo code at the end, clearly delimited and easily removable. I find it easier to test this way, having only one file: less clutter.
Oh, and the hyperlink works now, one have to remember to set this style at creation time.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Thu May 17, 2007 12:57 pm    Post subject: Reply with quote

Quote:
majkinetor, the problem isn't that your ideas are not good, it is in the way they are presented...

U are not the n00b, what do you expect, to draw it for you ?

Quote:
There is still the demo code at the end, clearly delimited and easily removable.

You still don't get it, but continue the same story.

Quote:
I find it easier to test this way, having only one file: less clutter.

I know its easier. For U. Contrary to that, entire comunity have to stick with bad thing for eternity. Now, if you adopt some rules, we can all live in peace, happily ever after.

RULE 1 (transparency)
User never have to look the source code of your include. Everything he needs to know should be documented externaly or in file header.

RULE 2 (invariant to environment)
Where the user includes your code must not be important. Is it top or bottom or middle, you don't care

RULE 3 (no garbage)
Test/Sample code must be separated from control. I don't need to include presentation garbage in my code, nor I wish to remove it every time I download a new version of your code.

RULE 4 - X (encapsulation)
Rules for code creation. 99% of your code I touched isn't encapsulated. You provide little scripts, that must be maintained before usage. I will create tutorial about good encapsulation when stdlib gets implemented (or sooner, if someone desires) but you are mature enough to most of that yourself


Some great ideas are left to die. For instance, your dumpdwords function was very useful, but I needed to read your docu carefuly (10 mins), examine your code to see what parameters to pass (10 mins), find your dependencies (5 min), check if all that source have garbage, like your above wrapper (??? min), and do that each time you release a new version. Now, if you download my wrapper, HexView, u don't need to do anything. Download wrapper (1 min) , put #include HexView.ahk wherever you want, and just use the thing. When I release new version, you overwrite your old include and live happilly ever after. Is that too much to ask ? There is no difference in developing speed, once U adopt this scenario.

Second, why must we re-code every thing when stdlib gets implemented ? U know now from our conversations in Devel forum, what kind of functionalities will be there in stdlib. So you must know that if you create good wrapper now, it can be used like that in StdLib or only with minor changes. As I see it now, smb responsible for stdlib will have to re-read, and re-code your entire wrapper.

Why do I talk this to U ? Perhaps you just want to relax and post code like you wish and don't care.

I tell you this because you are one of the few top posting members on this forum and your help and experiance are invaluable. If you don't show an example nobody will. Its time to understand your "responsiblities".

Or you can continue in relaxed manner and spread disorganisation around.
_________________
Back to top
View user's profile Send private message MSN Messenger
corrupt



Joined: 29 Dec 2004
Posts: 2328

PostPosted: Fri May 18, 2007 3:39 am    Post subject: Reply with quote

@majkinetor - last I checked participation (of any kind) here is voluntary... Wink

@PhiLho - Thanks Smile . The demo script didn't load the files automatically and gave a few "Error loading file" messages but ran fine after downloading the files.
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Fri May 18, 2007 8:23 am    Post subject: Reply with quote

Quote:
last I checked participation (of any kind) here is voluntary...
It shows...
_________________
Back to top
View user's profile Send private message MSN Messenger
daonlyfreez



Joined: 16 Mar 2005
Posts: 738
Location: Berlin

PostPosted: Fri May 18, 2007 10:17 am    Post subject: Reply with quote

@majkinetor: Everything here is voluntary. Though I agree some sort of standardisation would be good, pushing your own opinion on how this should look like unto others, and doing it rudely, will not help reaching such a goal.

And, like they say in German:

Der Ton macht die Musik (It's not what you say, but how you say it).
_________________


Get your own Ron Paul 2008 userbar!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Fri May 18, 2007 10:44 am    Post subject: Reply with quote

Argh, you ppl just talk and talk and talk... and do nothing.

Like I said, warez sites today , are better organised and more mature then this community. You should all be shame of yourselves, instad you chose to talk over and over... .I know this is voluntier job, what do you think, I am stupid ?.

Little kids can find "common language" more succesiffuly then we here.

And, like they say in Sebian:
You can't fuk without taking it
_________________
Back to top
View user's profile Send private message MSN Messenger
daonlyfreez



Joined: 16 Mar 2005
Posts: 738
Location: Berlin

PostPosted: Fri May 18, 2007 12:02 pm    Post subject: Reply with quote

Like I said: It's not what you say, but how you say it...
_________________


Get your own Ron Paul 2008 userbar!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Fri May 18, 2007 12:08 pm    Post subject: Reply with quote

Like I said: You can't fuk without letting it in.


Anyway, I was talking lot of times nice, but it didn't help, so your theory about "its how you say it" is totaly wrong in this case.
_________________
Back to top
View user's profile Send private message MSN Messenger
daonlyfreez



Joined: 16 Mar 2005
Posts: 738
Location: Berlin

PostPosted: Fri May 18, 2007 12:33 pm    Post subject: Reply with quote

I wouldn't agree, maybe you should try a bit more patience, it's a virtue...

Again: I agree with your intentions, but I too get annoyed with your tone.
_________________


Get your own Ron Paul 2008 userbar!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Fri May 18, 2007 1:21 pm    Post subject: Reply with quote

Quote:
but I too get annoyed with your tone.

Well, it's mutual. I get anoyed by disorganisation and constant theorysing about every stupid little thing, like this one. Its normal thing for more ppl doing the same thing to have some standards, entire community has huge benefits. Its not normal otherwise. My arogance has nothing to do with it. Most ppl around deserve it as they behave like they are on the picknick.

You act like spoiled kids. Smb gives you an chocholate and you say "You must say please, and I will maybe take it".

Quote:
I wouldn't agree, maybe you should try a bit more patience, it's a virtue...
I was patient. Now its time for action. I know you don't like it. Its in human nature, and you are, after all, only humans.

Quote:
I agree with your intentions,

Perhaps you should work more on supporting me instead moking how rude I am. Or we can continue with this useless conversation.
_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group