- This topic has 25 replies, 2 voices, and was last updated 6 years, 1 month ago by Support.
-
AuthorPosts
-
July 15, 2018 at 8:11 pm #37889SzakiLaciParticipant
Hi Serge, π
I've realized I need to upgrade to latest stable version because TsImage isn't working properly on old 2015.12 version.
There are many things changed since than (Congratulation for the great work!),
but that also creates new problems.
Please help me to understand, how can I make things work the “right way” again?
This topic should be a “little upgrade FAQ” for others too, if they encounter the same problems…
about:
- non skinned panels
- TsTreeView icons
- TsHackedControl / Button-coloring
- “Auto-gliph-coloring” on Cancel/Default buttons
- “FocusedColor” property
July 15, 2018 at 8:16 pm #58154SzakiLaciParticipant1.) First of all, MANY thanks for fixing TsImage problem π
(That's why I'm upgrading now.)
The new version finally shows ALL pictures, not just some π
Before (old version BAD) / After (current version OK):
[attachment=8821:TsImage_old.png] [attachment=8823:TsImage_new.png]
BUT! A stretching problem still exist:
– it should NOT load already cached/streched image and resize it!
– it should get the ORIGINAL image (even if VirtualList is added)
– I recommend to enhance the GetBitmap function with +1 parameter
– EXCEPT:
Code:((Stretched=True) & (Proportional=False) & (“VirtList.Size” = “Self.Size”)) or (AutoSize=TRUE)(if the showing-size is the same as the Imagelist-size, than it can use the already cashed+streched image)
BAD STRETCH:
[attachment=8822:TsImage_Stretch.png]
July 15, 2018 at 8:20 pm #58155SzakiLaciParticipant2.) Creating non-skinned Panels worked before.
Now it's trying to skin them always, no matter what I set:
This was happening at 2015 version only in cases, when I've changed skins during runtime.
Old version OK / New version BAD:
[attachment=8825:Panels_old.png] [attachment=8824:Panels_new.png]
Code:var
P: TsPanel;
begin
P := TsPanel.Create(Foform);
P.Parent := Holder_Panel; // this is a skinned panel
P.SkinData.CustomColor := True;
P.ParentFont := False;
P.SkinData.CustomFont := True;
//P.SkinData.SkinSection := ''; // old version worked by uncommenting this line
P.Font.Color := $0092B4DC; // halvΓ‘ny barna…
July 15, 2018 at 8:26 pm #58156SzakiLaciParticipant3.) TsTreeView does not show any more icons, only if selected.
(associated with a TsVirtualImageList)
Code:var nod : TTreeNode;
…
nod.ImageIndex := 27;
nod.SelectedIndex := nod.ImageIndex;
nod.StateIndex := nod.ImageIndex;Old version (OK) / New version (BAD):
[attachment=8826:TreeV_ikon_old.png] [attachment=8827:TreeV_ikon_new_no_icons.png]
July 15, 2018 at 8:36 pm #58157SzakiLaciParticipant4.) cConst.pas contained this before:
Code:TsHackedControl = class(TControl)
public
property AutoSize;
property ParentColor;
property Color;
property ParentFont;
property PopupMenu;
property Font;
end;(You've wrote it, and helped me once with it… no time to search for that old topic now.)
Old version (OK):
[attachment=8828:Redish_bitBtn.png]
At your (previous) recommendation I was able to color the background of a TsBitBtn with this code:
Code:TsHackedControl(bbtn_orderAlert).Color := clRed;This is not available any more.
Why did you delete it ? Is there any better way to do it?
July 15, 2018 at 8:39 pm #58158SzakiLaciParticipant5.) How do I turn OFF globally this new “auto-bitmap-coloring” on Cancel/Default buttons, etc…
Searched both at sSkinManager and sSkinProvider, but did not find any property for it.
Old (OK) / New (BAD):
[attachment=8829:Cancel_color_old.png] [attachment=8830:Cancel_color_override.png]
July 15, 2018 at 8:50 pm #58159SzakiLaciParticipant6.) Finally the most important:
Since 2012 I'm enhancing every version of sBitBtn with a “FocusedColor” property.
(To show focus for users in NON-skinned state too).
But I don't know how to implement this into the new version. π
It became too complicated for me now.
[attachment=8831:FocusedColor_of_TsBitBtn_non_Skinned.png]
The previous code I've always used was this:
Code:unit sBitBtn;
…
TsBitBtn = class(TBitBtn)
…
private
FFocusedColor: TColor; // by Laci 2012.08
…
public
property FocusedColor : TColor read FFocusedColor write FFocusedColor default clLime; // by Laci 2012.08…
procedure TsBitBtn.StdDrawItem(const DrawItemStruct: TDrawItemStruct);
…
if acThemesEnabled then begin
…
else
begin
Flags := DFCS_BUTTONPUSH or DFCS_ADJUSTRECT;
if IsDown then
Flags := Flags or DFCS_PUSHED;if DrawItemStruct.itemState and ODS_DISABLED 0 then
Flags := Flags or DFCS_INACTIVE;
// DrawFrameControl doesn't allow for drawing a button as the default button, so it must be done here
if IsFocused or IsDefault then begin
Canvas.Pen.Color := clWindowFrame;
Canvas.Pen.Width := 1;
Canvas.Brush.Style := bsClear;
Canvas.Brush.Color := FocusedColor; // by Laci 2012.08
Canvas.Rectangle(R.Left, R.Top, R.Right, R.Bottom);
// DrawFrameControl must draw within this border
InflateRect(R, -1, -1);
end;
// DrawFrameControl does not draw a pressed button correctly
if IsDown then begin
Canvas.Pen.Color := clBtnShadow;
Canvas.Pen.Width := 1;
Canvas.Brush.Color := FocusedColor;//clBtnFace; // by Laci 2012.08
Canvas.Rectangle(R.Left, R.Top, R.Right, R.Bottom);
InflateRect(R, -1, -1);
end
else
DrawFrameControl(DrawItemStruct.hDC, R, DFC_BUTTON, Flags);if IsFocused then begin
R := ClientRect;
InflateRect(R, -1, -1);
end;
Canvas.Font := Self.Font;
if IsDown then
OffsetRect(R, 1, 1);if IsFocused and IsDefault and ((SkinData.SkinManager = nil) or SkinData.SkinManager.ButtonsOptions.ShowFocusRect) then begin
Canvas.Pen.Color := clWindowFrame; // Laci >>
Canvas.Brush.Color := FocusedColor;//clBtnFace; // by Laci 2012.08
InflateRect(R, -2, -2);
Canvas.Rectangle(R); // << Laci
R := ClientRect;
InflateRect(R, -4, -4);
Canvas.Pen.Color := clWindowFrame;
Canvas.Brush.Color := clBtnFace;
DrawFocusRect(Canvas.Handle, R);
end;
end;
DrawCaption(Canvas);
DrawBtnGlyph(Self, Canvas);Canvas.Handle := 0;
Canvas.Free;
end;
end;July 15, 2018 at 9:27 pm #58160SzakiLaciParticipantI've just tried to send you a Donation via Skrill (Moneybookers) but it said:
“Transaction Failed
Recipient can not receive transactions at this time.
Please contact the recipient for more information.
ff8095b8-5869-4eaa-88e1-7a0dd4e1bc5d “
Did you cancel that account?
Can you try to re-login? (I had to renew my password via “forgotten psw” button)
July 16, 2018 at 10:16 am #58162SupportKeymasterHello!
I have sent request to the Skrill support, awaiting an answer now.
This topic is very big, answering to many question is not handy in the single topic…
6) The TsBitBtn control has the OnPaint event, maybe using this event will be better then adding of new property?
The code should not be changed after each new version release in this case…
July 16, 2018 at 10:20 am #58163SupportKeymaster5) Use the sSkinManager.ButtonsOptions.ModalButtonsColoring property, you can disable this feature there.
4) The acntTypes unit has been added where the TsHackedControl type has been replaced by TacAccessControl, you should use this new type.
July 16, 2018 at 10:41 am #58164SupportKeymaster3) I need a demo with this issue, can you make it?
July 16, 2018 at 10:46 am #58165SupportKeymaster2) SkinData.SkinSection property may be empty in latest versions of the package.
They are empty by default and default section used for a painting of control.
If control should not be skinned, use any text which is not a name of section ('N/A' for sample).
July 16, 2018 at 10:47 am #58166SupportKeymaster1) Can you show a demo for this issue?
July 18, 2018 at 11:03 pm #58204SzakiLaciParticipant'Support' wrote:1) Can you show a demo for this issue?
Sorry for the late response, took me a while to prepare 2 test-demos…
1.) TsImage + TsAlphaImageList/TsVirtualImageList (stretch) problems:
download source+exe from here… sImageTest.zip (1.1M:cool:
2.) [Solved] Panel non-skinned paint works fine with: 'N/A' π
3.) sTreeViewTest.zip DEMO (1.9M:cool:
(VirtualList icons not showing, alpha not working, too much left-intent)
4.) [Solved] acntTypes.pas >> TsHackedControl(xyz) π
5.) [Solved] sSkinManager.ButtonsOptions.ModalButtonsColoring π
6.) > “TsBitBtn control has the OnPaint…”
That would be a very complicated and slow approach. :36:
– I have 1000+ BitBtns in my APP.
– only 1 running OnPaint makes debugging nearly impossible too, not to mention 20-50 on every form.
– every (60+) forms are already prepared with OnCreate(), like:
Code:for i := 0 to f.ComponentCount-1 do begin
if f.Components is TsBitBtn then
TsBitBtn(f.Components).FocusedColor := clLime; // or clBlue on some forms…
end;It would be a REALLY REALLY big help, if you could enhance TsBitBtn with “FocusedColor” property yourself,
with the code I've already presented. PLEASE! :a8:
(it won't hurt anyone else either, maybe they would benefit also…)
Edit3: sTreeViewTest DEMO added.
July 21, 2018 at 4:34 am #58215SupportKeymasterThank you for projects, I will check them soon.
August 2, 2018 at 4:57 am #58256SzakiLaciParticipant'Support' wrote:Thank you for projects, I will check them soon.
Hi,
Any news on those fixes maybe?
Laci
August 6, 2018 at 4:27 am #58259SupportKeymasterHello
Issues 2 and 3 are solved in the latest version.
I'm thinking about the FocusedColor property, not sure this property will be used by other people.
Maybe you can use a helper with new property there?
August 16, 2018 at 4:22 pm #58282SzakiLaciParticipant'Support' wrote:Hello
Issues 2 and 3 are solved in the latest version.
Hi,
– I guess you mean 1+3 ? (because “2” has been solved at the beginning.) If yes >> that's very GREAT NEWS π :a3:
– There is still the 2018.07.08 version available for download only. Is there any new Beta so I could try?
'Support' wrote:I'm thinking about the FocusedColor property, not sure this property will be used by other people.
Maybe you can use a helper with new property there?
There are 69 Main + 33 Sub-properties of this component.
Do you think it would matter to have +1 ? .. even if nobody else would use it?
If it stays on default color >> it would skip anyway, so nobody would “get hurt by it” π
Code:If skin is turned OFF >> begin
If FocusedColor = clBlack then begin
… your code
end
else begin
… // set background color of button instead of clBtnFace
… // call standard drawing.
end;
end
else begin …PS.: Sorry for the late response. I don't get any email alerts on these forum replays π
PS2.: sent you a private msg about donation too.
August 20, 2018 at 6:51 am #58283SupportKeymasterHello!
AC v13.18 has been released at 28.07.2018
I will think about the FocusedColor property, how to make it better.
August 20, 2018 at 9:14 am #58286SzakiLaciParticipant'Support' wrote:Hello!
AC v13.18 has been released at 28.07.2018
I will think about the FocusedColor property, how to make it better.
Thank you VERY MUCH !! π
I've thought the fixes happened AFTER that. I'll test it now.
-
AuthorPosts
- You must be logged in to reply to this topic.