Welcome, Guest
Username: Password: Remember me
General Purpose Components and Libraries, discussions, problems and suggestions

TOPIC:

[LAB] Cindy components 6 years 6 months ago #11044

  • chor
  • chor's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
Hi Sternas, thanks for looking into this. I am using v6.00 with GTK2, hosted by Ubuntu 16.04 64bits, is there a patch I can apply to my current setup? Attached is an 'about' screen dump.

Many thanks,
Chor

Please Log in or Create an account to join the conversation.

[LAB] Cindy components 6 years 6 months ago #11045

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
unit cyBaseSpeedButton.pas

replace
procedure TcyBaseSpeedButton.DrawCaption

with this code
//--- ct9999 -----------------
procedure TcyBaseSpeedButton.DrawCaption(aRect: TRect; aState: TButtonState; Hot: Boolean; GlyphExists: Boolean);
var
  aAlignment: TAlignment;
  aTextLayout: TTextLayout;
  DrawStyle: LongInt;
  TmpFont: TFont;
  xTextStyle:TTextStyle;
begin
  if Caption = '' then EXIT;

  aAlignment := taCenter;
  aTextLayout := tlCenter;

  if GlyphExists
  then
    case Layout of
      blGlyphLeft:   aAlignment := taLeftJustify;
      blGlyphRight:  aAlignment := taRightJustify;
      blGlyphTop:    aTextLayout := tlTop;
      blGlyphBottom: aTextLayout := tlBottom;
    end;

  DrawStyle := cyGraphics.DrawTextFormatFlags(0, aAlignment, aTextLayout, FWordWrap);
 // DrawStyle := DrawTextBiDiModeFlags(DrawStyle);      ct9999

  if FCaptionOrientation = coHorizontal
  then begin
    xTextStyle:=Canvas.TextStyle;
    xTextStyle.Alignment:=taCenter;
    xTextStyle.Layout:= tlCenter;
    Canvas.TextRect(aRect,0,0,Caption,xTextStyle);
  end
  else begin
    // Use Canvas.Font because already assigned on DrawButton and can be changed on BeforePaint event !
    TmpFont := cyCreateFontIndirect(Canvas.Font, FCaptionOrientation);
    try
      Canvas.Font.Assign(TmpFont);
      cyDrawVerticalText(Canvas, Caption, aRect, DrawStyle, FCaptionOrientation, aAlignment, aTextLayout);
    finally
      TmpFont.Free;
    end;
  end;
end;
//---------------------------
PilotLogic Architect and Core Programmer
The following user(s) said Thank You: chor

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

[LAB] Cindy components 6 years 6 months ago #11059

  • chor
  • chor's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 4
  • Thank you received: 0
The patch has side effects on some of the cindy button, have worked round it for now. Many thanks for all your help. Really appreciate all the wonderful work you are putting into CodeTyphon. Looking forward to the new release!
Best Regards,
Chor

Please Log in or Create an account to join the conversation.

[LAB] Cindy components 6 years 6 months ago #11060

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Thanks Sir
have fun
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.