I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE

Prestwood eMagazine

June Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPascal and Delphi Coding BoardDelphi Object PASCAL Topic   Print This     

Help with Animated Forms

Help with Animated Forms in Delphi Object PASCAL topic (part of our Pascal and Delphi Coding group).

Quick Search: Animated   Animated   Animated Forms  
MerLiN
Australia
Hi,
I want to make my app disappear when the user double clicks on the title bar (just like a Linux app) so all that remains is the title bar, and when they double click on the title bar again the window animates back to its former self.
Can anybody help me with this?

Merlin
http://kickme.to/merlin73
 Posted 16 years ago (Thread Starter)
Comment Quote
About MerLiN -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9281, 7 replies
Thread Started 3/20/2003 8:23:00 PM
View Counter=3325
Last Reply Posted 4/2/2003 10:14:00 PM)
Location=Australia  
Joined=17 years ago   MB Posts=13  
rt
Castel, -- UK
Scott, I was intrigued to note that you used Delphi 5 for this and I would have assumed, you being at Prestwood that D7 would have been standard - I was just interested.

Thats enough of that. Ed.

 Posted 16 years ago
Comment Quote
About rt -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About rt

I do like my jazz and blues!


Post ID #9286 (Level 1.1)  Reply to 9281
Thread Started 3/21/2003 12:39:00 PM
View Counter=2
Location=Castel, -- UK 
Joined=19 years ago   MB Posts=687   KB Comments=1  
MerLiN
Australia
Thanks for the info Scott. I also posted this message in a delphi newsgroup and someone posted some code that works except I forgot to mention that I wanted the window to restore when double clicked again. But I have more to work on now so that's great.

I'm interested in looking at your demo app as well so if you wanna send it to merlin73@iprimus.com.au I would appreciate it.

One more question how can I add a button to the title bar? I was thinking it might be easier to "shrink/unshrink" my form with a customized button that sits next to the minimized button. I had a look in the help files, but only found info for disabling the 3 regular buttons.
http://kickme.to/merlin73
 Posted 16 years ago (Thread Starter)
Comment Quote
About MerLiN -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9290 (Level 1.2)  Reply to 9281
Reply Posted 3/21/2003 8:41:00 PM
Location=Australia  
Joined=17 years ago   MB Posts=13  
Most Recent Post
MerLiN
Australia
Thanks for the zip Scott. Unfortunately I couldn't examine it. I'm using Netscape on Linux and when I extracted it from the email it must have stuffed it up. No problem though... I've already found the code I needed for my program.

As for the buttons on the title bar, I know it can be done (although I don't know how). I've got a winamp plugin that puts all the winamp controls on any window that has focus next to the min/close buttons. But as I'm only a beginner programmer it sounds like it would be a lot of work to do something like that, so I think I'll forget about it for now. [Sigh]

But thanks anyway for the info.
http://kickme.to/merlin73
 Posted 16 years ago (Thread Starter)
Comment Quote
About MerLiN -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9355 (Level 1.3)  Reply to 9281
Reply Posted 4/2/2003 10:14:00 PM
Location=Australia  
Joined=17 years ago   MB Posts=13  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
Well, you'll be interested to know what events fire when you double-click the title bar... Confused



One would think that the logical form event would be OnDoubleClick, but that is not the case.



To research answers on this forum, I always like to throw together quick little demo apps to test before I give an answer. I built a test app that was just a simple form with event counters and labels showing the event count. I can email you the Delphi 5 project if you're interested in what I did.



When you double-click, of course, the default action is to maximize the form. Double-clicking the title bar is the exact same behavior as clicking the Maximize/Restore button on the Windows system menu on the title bar (the three icons in the upper-right corner).



What I found was that when you double-click the title bar, this triggers the OnResize event, the OnCanResize event, the OnResizeQuery event, and the OnConstrainedResize event, but no other events on the form!



Even more confusing is that when you double-click the title bar the second time, no events are triggered - not even OnResize or OnShow!



So, you'll have to tinker with this behavior, but I think you are going to have to modify the OnCanResize event to shrink the form to just the title bar - rather than maximizing the form. Since the second "double-click" sends out the Windows RESTORE event (which does not appear to be trapped), the form will most likely return to the last size it was when it is restored.
 Posted 16 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9282 (Level 1.4)  Reply to 9281
Reply Posted 3/21/2003 8:27:00 AM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
No, we use D5 and D6 here. We have not jumped on D7 yet. The only reason we would justify the upgrade is if we have a .Net project.



D6 is sufficient for 90% of our projects. I use D5 mostly for projects we sub-contract on (where the contractor is fully D5), or for simple things like this. I consider D5 to be the "baseline" for Delphi versions right now.
 Posted 16 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9288 (Level 1.5)  Reply to 9281
Reply Posted 3/21/2003 1:06:00 PM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
Well, my findings about the events that get triggered should give an indication of the answer...



It is my understanding that the frame of your form - which includes the title bar - is the result of the underlying CreateWindowsEX call - which is Windows SDK. The VCL just simplifies this call by doing the dirty work for you in the TForm's constructor.



So for a standard form, you can't add buttons to the System menu or the title bar - that's Windows domain, not Borland.



But I have been told many times that there is nothing that can't be done in Windows programming if you want to do it. I've done my fair share of inherited forms, and plenty of spelunking into the VCL source to find hidden functionality, but based on what I've found so far, I don't see how you could modify what Windows gives you here.



This may call for a trip to the "Secrets of Win32 Programming" book, or some other reference that goes beyond what Delphi has to give.
 Posted 16 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9297 (Level 1.6)  Reply to 9281
Reply Posted 3/24/2003 6:16:00 AM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  
Scott Wehrly
Prestwood IT
 (Inactive)
Las Vegas, NV USA
Oh, yes. Almost forgot. I'm sending a Zip file of my test form down under...
 Posted 16 years ago
Comment Quote
About Scott Wehrly -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #9298 (Level 1.7)  Reply to 9281
Reply Posted 3/24/2003 6:19:00 AM
Location=Las Vegas, NV USA 
Joined=17 years ago   MB Posts=442   KB Posts=19  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1194A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #9281 Counter
3325
Since 4/2/2008
Follow PrestwoodBoards on: 


©1995-2019 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech