Forum Replies Created
-
AuthorPosts
-
ralfiiiParticipant
Thanks, that works perfectly!
ralfiiiParticipantAfter thinking for some time I found a “solution”.
Actually it's not a solution, it's just a request for a more general solution for such problems:
####
Now that I have to make an app with a cool design I VERY often would need a fully transparent button (TsButton, TsSpeedButton or whatever…) combined with a set of images (+ an optional caption).
When you hover the mouse over it or press it, it simply shows the corresponding images just like TsButton where we can use HotImageIndex, PressedImageIndex etc.
But in any case it does NOT show it's borders, it only shows the images.
This way we could easily create buttons that have odd shapes. You simply get partly transparent png images for the normal/hover/pressed-state from a designer and wire it to the transparent button.
(in reality the buttons are rectangular, but the user only sees the image).
This is something that is REALLY missing in the AC-pack
November 11, 2011 at 1:09 pm in reply to: How to create an AC-independent component that is skinned properly? #47187ralfiiiParticipantI tested it and it works.
You're a genious! :a3:
Thanks!!!!
I attach the file just in case anybody wants it as a reference.
November 11, 2011 at 11:59 am in reply to: How to create an AC-independent component that is skinned properly? #47182ralfiiiParticipant'Support' wrote:I'm sorry, you are right. Some errors exists in my previous code. Try this
Still doesn't work.
Don't I have to assign the Painting-rect?
I tried
Code:procedure TTest.Paint;
…
if ParentBGInfo.BgType btUnknown then
begin // Parent is not AlphaControl
ParentBGInfo.BgType := btUnknown;
ParentBGInfo.PleaseDraw := False;
ParentBGInfo.R:=Rect(Left, Top, Left+Width, Top+Height);
SendMessage(Parent.Handle, $A100{SM_ALPHACMD}, MakeWParam(0, 34{AC_GETBG}), LPARAM(@ParentBGInfo));
end;But this also didn't work.
AND: If I simply clear ParentBGInfo
FillChar(ParentBGInfo, sizeof(TacBGInfo), 0);
before I do anything with it, nothing happens anymore, then the component isn't transparent even when placed on a panel.
Somethings terribly wrong here.
If you like I can send a tiny demo application, so you could correct it in there.
November 11, 2011 at 11:17 am in reply to: How to create an AC-independent component that is skinned properly? #47177ralfiiiParticipantI think I will simply use a “UseAlphaControls” define.
Thanks for your help!
November 11, 2011 at 10:31 am in reply to: How to create an AC-independent component that is skinned properly? #47175ralfiiiParticipantI suppose you mean LPARAM(@BGInfo), right? (the @-symbol was missing)
hmmm… still, it's not really working well.
If I place the control on a TsPanel then it's really transparent.
If I place it directly on a Form then the form is skined but the control itself remains opaque.
If I place it on a TsPanel which is transparent because the BevelOuter is set to bvNone then it's also opaque.
And the line
ParentBGInfo.Color := Parent.Color
doesn't compile as Parent.Color seems not to be available.
Here's the source with both paint methods, selectable with a define:
Code:{$DEFINE Independent}{$IFDEF Independent}
uses Graphics, Windows;
{$ELSE}
uses Graphics, Windows, sGraphUtils, sConst;
{$ENDIF}{$IFDEF Independent}
type
PacBGInfo = ^TacBGInfo;
TacBGType = (btUnknown, btFill, btCache, btNotReady); // Returned by control type of BG
TacBGInfo = record
Bmp : Graphics.TBitmap;
Color : TColor; // Color returned if btFill is used
Offset : TPoint; // Offset of bg, used with Cache
R : TRect; // Rectangle used if PlsDraw is True
BgType : TacBGType; // btUnknown, btFill, btCache
PleaseDraw : boolean; // Parent must fill rectangle(R)
DrawDC : hdc; // Device context for drawing, if PleaseDraw is True
end;// from sMessages.pas
var
SM_ALPHACMD : LongWord;
const
AC_GETBG = 34;
{$ENDIF}procedure TTest.Paint;
var
ParentBGInfo : TacBGInfo;
begin
Canvas.Lock;{$IFDEF Independent}
Perform(SM_ALPHACMD, MakeWParam(0, AC_GETBG), LPARAM(@ParentBGInfo));
if ParentBGInfo.BgType btUnknown then
begin // Parent is not AlphaControl
ParentBGInfo.Color := clRed; // Parent.Color is not reachable ?!?!?
ParentBGInfo.BgType := btFill;
end;
{$ELSE}
GetBGInfo(@ParentBGInfo, Parent); // Receive a BG information from parent
if ParentBGInfo.BgType = btCache then
begin // If BG is accessible as bitmap
BitBlt(Canvas.Handle, 0, 0, Width, Height, ParentBGInfo.Bmp.Canvas.Handle,
Left + ParentBGInfo.Offset.x, Top + ParentBGInfo.Offset.y, SRCCOPY);
end
else // Else just filled by received color
FillDC(Canvas.Handle, Rect(0, 0, Left+Width+1, Top+Height+1), ParentBGInfo.Color);
{$ENDIF}// Data output
Canvas.rectangle(width div 5, Height div 5, 4*(width div 5), 4*(Height div 5));Canvas.UnLock;
end;…
{$IFDEF Independent}
initialization
SM_ALPHACMD := RegisterWindowMessage('SM_ALPHACMD');
if True or (SM_ALPHACMD < $C000) then SM_ALPHACMD := $A100;
{$ENDIF}ralfiiiParticipantok, thanks!
ralf
ralfiiiParticipant'Support' wrote:Hello
You can try this code
Code:sSkinProvider1.Adapter.AddNewItem(sBtn);As this is the main form I don't have a SkinProvider there, only a SkinManager.
Is “Adapter” (or similar) also available from a TsSkinManager-Component?
Or should I place a SkinProvider on the mainform also anyway? (I thought I only need SkinProvider on additional forms)
Thanks!
ralfiiiParticipantI just downloaded and installed version 7.48 and it solves the problem.
You're the man!!!!
Thanks a lot!
ralfiiiParticipantTrue, in this case it helps, but in my real-life application I am having SkinProviders there and it still fails.
Unfortunately the “real” app is much too big to post it here.
Can you please have a look into that issue?
Thanks,
Ralf S.
'Support' wrote:Hello
Thank you, I see this issue and will research it.
Try to place TsSkinProvider component, I think it helps.
ralfiiiParticipant'Support' wrote:You uses OnPaint event?
I created a TPanel-decendant with an overwritten Paint-method.
ralfiiiParticipantHey!
Thanks for your response, but I've implemented a neat vertical button in the meantime.
So you can save your time for enjoying the sunny weather 😉
Thanks anyway!
Ralf
'Support' wrote:Hello Ralf
This feature should be added specially. I have added it in ToDo list, but can't promise a quick implementation.
ralfiiiParticipant'HeDiBo' wrote:You're amazing: that solved it
Is there a similar function to slide out a panel (I don't mean the TsFrameBar, but an animation function that will slide a panel out of nothing in a given direction). If you look at my screen shot, you can see that it would look even nicer if the panel would slide out of the button and back in again.
Did you implement such an iPhone-like window-that-slides-out function?
If yes: Could you provide some code and/or even a demo-app?
I need to implement exactly the same thing now, and it's always nice if you don't need to re-invernt the wheel…
Thanks in advance!
Ralf
ralfiiiParticipant'Support' wrote:Ralfii, if you want we can talk later via ICQ or Skype, maybe some solution will be found.
I've sent you my skype-ID via PM
Thanks!
ralfiiiParticipant'HeDiBo' wrote:Since TJvRollOut descends from TCustomPanel, you might try to add it to the list of ThirdParty controls as a Panel component.
Doesn't work as then the title area is not draw unless you hover the mouse over it.
(see attached picture, right pic. made after hovering over)
ralfiiiParticipant'Support' wrote:I think, it's possible.
Hey great!!!
Thanks a lot in advance!
ralfiiiParticipant'Support' wrote:Hello
I'll add this topic in ToDo list, but I can't say when skinning of TabSet will be implemented.
Great!
Take your time, it's not urgent, I am planning the release by the end of this year, so I have plenty of time…
If you simply skin TTabSet, would the tabs have a mouse-over effect?
If not it would be great if you could consider an own component that supports that. Would look so much better…
Thanks again, really a great component package!
ralfiiiParticipant'Support' wrote:Remove biMaximize from BorderIcons.
You're the man!!!
Thanks!
ralfiiiParticipant'Support' wrote:Thank you.
What is version of your JVCL?
Your demo working well, but my Exe don't work after recompiling (form position does not saved/restored). How can I activate TJvFormStorage component?
Uups, sorry, tht was written with a patched JVCL version that doesn't require an appstorage-component to store the window position.
I've attached a new version that brings the skin with it and also has the formstorage set up properly.
(you only need to drop a TJvAppRegistryStorage on the form, set the property “Root” to “SoftwareAcTestApp” (as an example) and set the property “AppStorage” of the JvFormStorage to it.
All done in the sample.
Thanks in advance for your help.
ralfiiiParticipant'Support' wrote:You should store and load 3 properties of the TsSkinManager component in this order : SkinDirectory, SkinName, Active
That's no problem for my own applications, I was just suggesting to also do that in the demo application that comes with AlphaSkins.
-
AuthorPosts