Re: [Lazarus] How do you remove form caption area?

2013-10-05 Thread Anthony Walter
BorderStyle := bsNone

And that removes the border. See the original linked screenshot.

http://codebot.org/snapshops/no-caption.jpg


On Sat, Oct 5, 2013 at 12:09 AM, leledumbo leledumbo_c...@yahoo.co.idwrote:

 BorderStyle := bsNone



 --
 View this message in context:
 http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-do-you-remove-form-caption-area-tp4033716p4033717.html
 Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you remove form caption area?

2013-10-05 Thread leledumbo
No idea then, seems to be Windows API specific



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-do-you-remove-form-caption-area-tp4033716p4033726.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you remove form caption area?

2013-10-05 Thread silvioprog
uses
  unit2;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2 := TForm2.Create(Self);
  Form2.ShowModal;
  Form2.Free;
end;

---

uses
  Windows;

procedure TForm2.FormShow(Sender: TObject);
begin
  SetWindowLong(Handle, GWL_STYLE,
GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION));
  SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,
SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE);
end;

-- 
Silvio Clécio
My public projects - github.com/silvioprog
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you remove form caption area?

2013-10-05 Thread silvioprog
2013/10/5 silvioprog silviop...@gmail.com

 uses
   unit2;

 procedure TForm1.Button1Click(Sender: TObject);
 begin
   Form2 := TForm2.Create(Self);
   Form2.ShowModal;
   Form2.Free;
 end;

 ---

 uses
   Windows;

 procedure TForm2.FormShow(Sender: TObject);
 begin
   SetWindowLong(Handle, GWL_STYLE,
 GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION));
   SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,
 SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE);
 end;


In mainform:

unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Windows, Forms;

type

  { TForm1 }

  TForm1 = class(TForm)
procedure FormShow(Sender: TObject);
  private
procedure WMNCHitTest(var Msg: TMessage); message WM_NCHITTEST;
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

procedure TForm1.FormShow(Sender: TObject);
begin
  SetWindowLong(Handle, GWL_STYLE, WS_OVERLAPPEDWINDOW and (not
WS_CAPTION));
  SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_DRAWFRAME or
SWP_NOMOVE or SWP_NOSIZE);
end;

procedure TForm1.WMNCHitTest(var Msg: TMessage);
begin
  inherited;
  case Msg.Result of
HTTOP: Msg.Result := HTCLIENT;
HTTOPLEFT: Msg.Result := HTCLIENT;
HTTOPRIGHT: Msg.Result := HTCLIENT;
HTBOTTOM: Msg.Result := HTCLIENT;
HTBOTTOMLEFT: Msg.Result := HTCLIENT;
HTBOTTOMRIGHT: Msg.Result := HTCLIENT;
HTLEFT: Msg.Result := HTCLIENT;
HTRIGHT: Msg.Result := HTCLIENT;
  end;
end;

end.

-- 
Silvio Clécio
My public projects - github.com/silvioprog
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you remove form caption area?

2013-10-05 Thread Graeme Geldenhuys
On 2013-10-05 15:32, silvioprog wrote:
 procedure TForm2.FormShow(Sender: TObject);
 begin
   SetWindowLong(Handle, GWL_STYLE,
 GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION));
   SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,
 SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE);
 end;


Does LCL not have a TPopupWindow class? eg: like you would use for Hint
Windows, Splash Screens etc? Weird.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you remove form caption area?

2013-10-05 Thread Howard Page-Clark

On 05/10/2013 16:25, Graeme Geldenhuys wrote:


Does LCL not have a TPopupWindow class? eg: like you would use for Hint
Windows, Splash Screens etc? Weird.


There is THintWindow in the Forms unit, but AFAIK it does not allow the 
kind of border the OP wants without resorting to calls such as 
SetWindowPos of which silvio gave an example.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you remove form caption area?

2013-10-05 Thread Zaher Dirkey
In Delphi we set Caption to '' and BorderIcons = [] but that not work in
Lazarus


On Sat, Oct 5, 2013 at 5:32 PM, silvioprog silviop...@gmail.com wrote:

 uses
   unit2;

 procedure TForm1.Button1Click(Sender: TObject);
 begin
   Form2 := TForm2.Create(Self);
   Form2.ShowModal;
   Form2.Free;
 end;

 ---

 uses
   Windows;

 procedure TForm2.FormShow(Sender: TObject);
 begin
   SetWindowLong(Handle, GWL_STYLE,
 GetWindowLong(Handle, GWL_STYLE) and (not WS_CAPTION));
   SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0,
 SWP_DRAWFRAME or SWP_NOMOVE or SWP_NOSIZE);
 end;

 --
 Silvio Clécio
 My public projects - github.com/silvioprog

 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




-- 
I am using last revision of Lazarus, FPC 2.6 on Windows XP SP3

Best Regards
Zaher Dirkey
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] How do you remove form caption area?

2013-10-04 Thread Anthony Walter
I want to a design form with controls on it but without a caption area,
much like to window:

http://codebot.org/snapshops/no-caption.jpg

How is this possible with the LCL?
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] How do you remove form caption area?

2013-10-04 Thread leledumbo
BorderStyle := bsNone



--
View this message in context: 
http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-How-do-you-remove-form-caption-area-tp4033716p4033717.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus