Board index » cppbuilder » Re: changing form properties before maximising

Re: changing form properties before maximising


2003-08-14 04:43:55 PM
cppbuilder63
"mostuff" <don' XXXX@XXXXX.COM >wrote:
Quote
[...] the same look as the bcb ide and [...] how to mimic
the resizing of [...] the editor window. [...]

void __fastcall TClientList_Form::FormResize(TObject *Sender)
{
Top = Main_Form->Height + 2;
Height = Screen->Height - Main_Form->Height - 26;
}
Note that the IDE does allow you to get a full screen editor.
In it's fsNormal state, you can move it to 0,0 and resize it.
Using the FormResize this way would prevent that.
Quote
[...] is there a way of copying the bcb behaviour?
Sure. I tested the following method and it works but it
doesn't have the 'exact' behavior as the IDE (that would
require more code and lots more digging ) but it's close
enough.
~ JD
//--- Form2 Header -----------------------------------------
__published: // IDE-managed Components
protected: // User declarations
virtual void __fastcall WndProc(TMessage &Message);
//--- Form2 Unit -------------------------------------------
void __fastcall TForm2::WndProc( TMessage& Message )
{
if( Message.Msg == WM_SYSCOMMAND )
{
if( Message.WParam == SC_MAXIMIZE ) // form is about to be maximized
{
TRect R = Screen->WorkAreaRect;
int DeskTopHeight = R.bottom - R.top;
int DeskTopWidth = R.right - R.left;
// Prevent screen updates
LockWindowUpdate( Handle );
// Maximize the window
TForm::WndProc( Message );
// Resize and reposition the form
Left = 1;
Top = Form1->Height + 2;
Width = DeskTopWidth;
Height = DeskTopHeight - Top;
// Allow Screen updates to happen
LockWindowUpdate( 0 );
}
else TForm::WndProc( Message );
}
else TForm::WndProc( Message );
}
//-------------------------------------------------------------
 
 

Re:Re: changing form properties before maximising

worked beuatifully, thanks.
 

Re:Re: changing form properties before maximising

i take that back actiually. it almost works perfectly except that if i
double click on the title bar of the second form it maximises to the full
screen. do you know what message is sent when the title bar is double
clicked?
TIA
 

{smallsort}

Re:Re: changing form properties before maximising

"mostuff" <don' XXXX@XXXXX.COM >wrote:
Quote
[...] what message is sent when the title bar is double clicked?
WM_NCLBUTTONDBLCLK
~ JD