Only skin borders and titlebar?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34999
    Ronald
    Participant

    Hello,

    At the moment I'm evaluating the lite-version of AlphaControls for Delphi2007. I have some questions an/or requests:

    – Would it be possible to restrict skinning to the borders and title of a form? So, not to any component or the form itself.

    – I have many forms which only resize in height. Can this be done when skinned? Maybe an option like NoReSizing, ReSizeVert, ReSizeHorz and ReSizeBoth. The cursor may not change is resize in a chosen direction is not possible!

    – When I do want to skin all of the form and I'm using thirdparty (or selfmade) components which are not supported, can I skin them myself? Or would this be very difficult.

    TIA,

    Ronald

    #47625
    Support
    Keymaster

    Hello

    'Ronald' wrote:
    – Would it be possible to restrict skinning to the borders and title of a form? So, not to any component or the form itself.

    Try to use the TsSkinProvider.DrawNonClientArea property

    Quote:
    – I have many forms which only resize in height. Can this be done when skinned? Maybe an option like NoReSizing, ReSizeVert, ReSizeHorz and ReSizeBoth. The cursor may not change is resize in a chosen direction is not possible!

    Behaviour of skinned form is equal to standard, so you can use constraints and other standard properties.

    Quote:
    – When I do want to skin all of the form and I'm using thirdparty (or selfmade) components which are not supported, can I skin them myself? Or would this be very difficult.

    You can try to add your control into TsSkinManager.ThirdParty property (case sensitive). There you can choose a type of skinning for a control. If your component is inherited from standard control, then this component may be skinned usually.

    #47639
    Ronald
    Participant

    When I use TsSkinProvider.DrawNonClientArea I get the exact opposite from what I want. I would need something like:

    SkinProvider.DrawClientArea := False; // only borders and title are drawn

    Your suggestion 'Behaviour of skinned form is equal to standard, so you can use constraints and other standard properties' doesn't work for me. When using a standard delphi-form I'm using the following code to prevent horizontal resizing:

    procedure TForm1.WMNCHitTest(var Message: TWMNCHitTest);

    begin

    inherited;

    if Message.Result in [HTLEFT, HTBOTTOMLEFT, HTTOPLEFT, HTRIGHT, HTBOTTOMRIGHT, HTTOPRIGHT] then

    begin

    Message.Result := HTNOWHERE;

    end;

    end;

    The above code doesn't work when the form is skinned! I have tried to use TSkinProvider.OnExtHitText (with similar code) to get the same functionality but that didn't work either.

    Any suggestions?

    TIA

    #47669
    Support
    Keymaster

    I'll try to change a work of the WM_NCHitTest event in the next relese.

    Code for the OnExtHitText event :

    Code:
    procedure TForm1.sSkinProvider1ExtHitTest(var Msg: TWMNCHitTest);
    const
    CornerWidth = 6;
    var
    BordWidth, SysBordWidth : integer;
    MouseInternalPos : TPoint;
    begin
    if sSkinProvider1.BorderForm nil then begin
    MouseInternalPos.X := Msg.XPos – sSkinProvider1.BorderForm.AForm.Left;
    MouseInternalPos.Y := Msg.YPos – sSkinProvider1.BorderForm.AForm.Top;
    BordWidth := SkinBorderWidth(sSkinProvider1.BorderForm);
    SysBordWidth := SysBorderWidth(Self.Handle, nil, False);
    if (MouseInternalPos.X > BorderWidth) and (Msg.XPos <= Self.Left + SysBordWidth + CornerWidth) or
    (MouseInternalPos.X = Self.Left + Self.Width – SysBordWidth – CornerWidth) then begin
    Msg.Result := HTCLIENT;
    end;
    end;
    end;
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.