× General Purpose Components and Libraries, discussions, problems and suggestions

Question [LAB] Cindy components

More
2 years 9 months ago #11044 by chor
Replied by chor on topic [LAB] Cindy components
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
Attachments:

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
2 years 9 months ago - 2 years 9 months ago #11045 by Sternas Stefanos
Replied by Sternas Stefanos on topic [LAB] Cindy components
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
Last edit: 2 years 9 months ago by Sternas Stefanos.
The following user(s) said Thank You: chor

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

More
2 years 9 months ago #11059 by chor
Replied by chor on topic [LAB] Cindy components
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar Topic Author
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
2 years 9 months ago #11060 by Sternas Stefanos
Replied by Sternas Stefanos on topic [LAB] Cindy components
Thanks Sir
have fun

PilotLogic Architect and Core Programmer

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