Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread Draggable forms and form captions (EWB1 like form.ShowBorder)
Wed, Jun 17 2015 9:35 PMPermanent Link

Trinione

Using the EWB1 EmbedForm example project as a reference, can EWB2 forms be:

(1) Draggable
and
(2) have a EWB1 like 'form.ShowBorder'?

For the EWB1 like border I noted in this post (http://goo.gl/RikdDY) that Tim stated

<< add 2 new panels: a TCaptionBar control and a TScrollPanel  control.  The TCaptionBar will default to looking like a form caption, but will also allow you to drop in edits, icons, etc. >>

I am thinking the idea for TCaptionBar is the current THeaderPanel component? Is that so, or am I wrong with that assumption?

Anyone know how to make a EWB2 form draggable?
Wed, Jun 17 2015 10:29 PMPermanent Link

Rick

On 18/06/15 11:35, Trinione wrote:
>
> Anyone know how to make a EWB2 form draggable?
>

Tim has stated that drag capability will be available soon after EWB2 is GA.

I am also keen to have this support and have implemented it myself in
EWB2 by updating the supplied webforms.wbs unit and adding the
DoCaptureStart, DoCapturing and DoCaptureEnd events to the
TDialogCaptionBar component. This enabled dragging on any form using a
caption bar (e.g. TDialog) including ShowMessage, etc.

Tim has done a great job with this and the capture events really make
the process very easy.

My guess is dragging support will be added very soon after GA so
probably worth waiting for that.

--
Rick
Thu, Jun 18 2015 9:22 AMPermanent Link

Trinione

<< ... soon after EWB2 is GA. >>

GA? Georgia? Smilelol. I have no idea what GA means here.


<< I am also keen to have this support and have implemented it myself in EWB2 by updating the supplied webforms.wbs unit and adding the  DoCaptureStart, DoCapturing and DoCaptureEnd events to the  TDialogCaptionBar component. This enabled dragging on any form using a  caption bar (e.g. TDialog) including ShowMessage, etc.>>

Do you mind sharing as this would not only be a workaround if its not in the initial release, but the approach would certainly help understand the DoCapture and related methods.


<< My guess is dragging support will be added very soon after GA so probably worth waiting for that. >>

Definitely.

Thanks.
Thu, Jun 18 2015 9:46 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 6/18/2015 9:22 AM, Trinione wrote:
> GA? Georgia? Smilelol. I have no idea what GA means here.

https://en.wikipedia.org/wiki/Software_release_life_cycle#General_availability_.28GA.29

Raul
Thu, Jun 18 2015 10:30 PMPermanent Link

Steve Gill

Avatar

<< GA? Georgia? Smilelol. I have no idea what GA means here. >>

I hadn't heard of it either until I followed Raul's link. We use Alpha, Beta, Gamma, Delta.

= Steve
Fri, Jun 19 2015 2:41 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Nor had I, or the RTW (Release To Web) I guess that one is a sign of the
times Smiley

The most interesting part I thought was the image that showed the
milestones in a product life cycle. It showed that between GA and LOD
(Last Order Date) was a minimum of 3 years. Does this mean that if you
release a product it has to be for sale for at least 3 years?

Chris Holland
[Team Elevate]

On 19/06/2015 03:30, Steve Gill wrote:
> << GA? Georgia? Smilelol. I have no idea what GA means here. >>
>
> I hadn't heard of it either until I followed Raul's link. We use Alpha, Beta, Gamma, Delta.
>
> = Steve
>
Fri, Jun 19 2015 6:47 AMPermanent Link

Rick

On 18/06/15 23:22, Trinione wrote:
> Do you mind sharing as this would not only be a workaround if its not in the initial release, but the approach would certainly help understand the DoCapture and related methods.
>
>

Sure. Basically Tim directed me to have a look at the TSizer control in
the WebSizer unit so that's where I started.

1. Create a new project and select TDialog as the main form.
2. Save project into a new directory.
3. Copy the WebForms.wbs file from the EWB2 install library directory
into the new project directory.
4. Update WebForms.wbs file in the project directory as follows:

4a. Update the TDialogCaptionBar class definition by adding the following:

 TDialogCaptionBar = class(TCaptionBarControl)
      private
         FdX,FdY: integer;
      protected
         function DoCaptureStart(Button: integer; ShiftKey, CtrlKey,
AltKey: boolean; X,Y: integer): boolean; override;
         procedure DoCapturing(X,Y: integer); override;
         procedure DoCaptureEnd(X,Y: integer); override;

4b. Add the following TDialogCaptionBar methods:

function TDialogCaptionBar.DoCaptureStart(Button: integer; ShiftKey,
CtrlKey, AltKey: boolean; X,Y: integer): boolean;
begin
if (Button=MB_NONE) or (Button=MB_LEFT) then
 begin
  FdX:=X-Parent.Left;
  FdY:=Y-Parent.Top;
  if Parent.Layout.Position<>lpNone then
   begin
    Parent.Layout.Position:=lpNone;
    Parent.Left:=X-FdX;
    Parent.Top:=Y-FdY;
   end;
  Cursor:=crMove;
  Result:=True;
 end
else
 Result:=False;
end;

procedure TDialogCaptionBar.DoCapturing(X,Y: integer);
begin
Parent.Left:=X-FdX;
Parent.Top:=Y-FdY;
end;

procedure TDialogCaptionBar.DoCaptureEnd(X,Y: integer);
begin
Cursor:=crAuto;
end;

5. Run the application.

The main form should now be draggable by the caption bar. If you put a
button on the form and set the OnClick event to perform a ShowMessage
then that popup should also be draggable via the caption bar.

If you want to enable dragging beyond the browser dimensions then define
a TForm1.OnCreate event as follows:

procedure TForm1.Form1Create(Sender: TObject);
begin
Application.Surface.ScrollBars:=sbBoth;
end;

The whole thing is pretty minimal and rough but hopefully it does what
you want. We can expect that when Tim implements it it will be much more
robust but this works for me in the meantime.

--
Rick
Fri, Jun 19 2015 5:20 PMPermanent Link

Trinione

Rick:
Great! This is good to know just to work with EWB2 and build confidence.

EWB2 release date is just days away so I will see if its implemented there. If not, I will use this approach when needed.

Thanks.
Sat, Jun 20 2015 6:55 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< I hadn't heard of it either until I followed Raul's link. We use Alpha,
Beta, Gamma, Delta. >>

I use "almost done", "getting there", "shouldn't be much longer", "had some
setbacks", "getting close", "I have no idea", and "it's finally done".....
Smile

Tim Young
Elevate Software
www.elevatesoft.com
Sat, Jun 20 2015 6:58 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Rick,

<< My guess is dragging support will be added very soon after GA so probably
worth waiting for that. >>

The issue is making things just "draggable" vs. a more complete
implementation of drag/drop support, and I want to get it right instead of
just adding dragging support and calling it a day.  This is similar to the
animation support, which was okay, but not great, in EWB 1 and lacked a lot
of flexibility.  It's all about the design.... Smile

Tim Young
Elevate Software
www.elevatesoft.com
Page 1 of 2Next Page
Jump to Page:  1 2
Image