dbTalk Databases Forums  

Add button to Title bar

comp.databases.paradox comp.databases.paradox


Discuss Add button to Title bar in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Jim Moseley
 
Posts: n/a

Default Re: Add button to Title bar - 12-14-2006 , 06:38 PM







Rick,
Quote:
Can you use a menu item.
No, since it is a dialog window, which doesn't have access to the Paradox
desktop's menu.

Thanks,
Jim Moseley


Reply With Quote
  #12  
Old   
Robert Molyneux
 
Posts: n/a

Default Re: Add button to Title bar - 12-15-2006 , 02:34 PM






If you are using multiple monitors, can you set up so that the monitors form
one large screen?

Then the user would be able to drag forms within the Paradox screen, and you
could control placement as per normal.

"Jim Moseley" <jmose (AT) mapson (DOT) attglobal.net> wrote

Quote:
Rick,
Can you use a menu item.

No, since it is a dialog window, which doesn't have access to the Paradox
desktop's menu.

Thanks,
Jim Moseley



Reply With Quote
  #13  
Old   
Jim Moseley
 
Posts: n/a

Default Re: Add button to Title bar - 12-16-2006 , 12:35 AM




FYI, here's what I ended up doing to solve my problem.

I created a small non-modal dialog control form, that just had 3 buttons
- Pin Here, Reset, and a checkbox for 'Dialog?', but no title bar, dialog
frame, or mouse activation. When this control form is opened and/or moved,
the SetWindowPos code below is called. This will keep the control form on
top, but not give it focus. More importantly, it doesn't steal focus from
the main form.

Before the main form is opened, it is checked to see if the user has flagged
it as a dialog and if so, openAsDialog() is used. It is also checked to
see if they've previously pinned the form, & if so the desired x,y is set
from that.

If the main form is opened as a dialog, the control form is opened & positioned
on the main form's title bar. There could be several control forms open
at once (for different main forms), so the control form's title is set to
the main form's plus a constant string.

Everytime the main form is moved (menuControlMove), the control form is also
moved by the same x,y changes. Since all my move code is in a library, the
menuAction must doDefault before calling the library methods.

On the main form's menuCanClose, I check to see if there is a control form
and close it also.

Problems with this approach:
1. The control form doesn't move seamlessly with the main form. It only
moves when the main form is done moving.
2. The control form isn't transparent, so it obscures some of the main form's
title bar.

Any suggestions on these 2 problems? Otherwise, it works great. Thanks
for all the input.

Jim Moseley


uses USER32
SetWindowPos(WinHandle CLONG,
WinHandleInsertAfter CLONG,
X CLONG, Y CLONG, CX CLONG, CY CLONG,
wFlags CLONG)
endUses
var HWND_TOP, windowParm longint endvar

HWND_TOP = 0
SWP_NOSIZE = 1 ; &H1
SWP_NOMOVE = 2 ; &H2
SWP_NOACTIVATE = 16 ; &H10
SWP_SHOWWINDOW = 64 ; &H40
windowParm = SWP_NOACTIVATE + SWP_NOSIZE + SWP_NOMOVE
SetWindowPos(siWinHandle, HWIND_TOP, 0,0,0,0, windowParm)

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.