Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-01

Getting the IDE source editor font

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi,

Since the recent font handling changes, some dialogs in the IDE that are using TSynEdit have become unreadable (font size down to 6 pixels or less). The query editors of SQLDB for instance.
I want to remedy this by setting the font for these synedit controls to the same font as used by the source editor.

How can I achieve this ? How to obtain the font specs for the source editor ?

Michael.

Reply by email

Mattias Gaertner
to Unknown author

?
?

hat am 24. Januar 2011 um 11:57 geschrieben:

Show quoted text 11 lines
Hi, Since the recent font handling changes, some dialogs in the IDE that are using TSynEdit have become unreadable (font size down to 6 pixels or less). The query editors of SQLDB for instance. I want to remedy this by setting the font for these synedit controls to the same font as used by the source editor. How can I achieve this ? How to obtain the font specs for the source editor ??

uses SrcEditorIntf;
SourceEditorManagerIntf.GetEditorControlSettings(ASynEdit); ?
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110124/370d8bf2/attachment.html>

Reply by email

Mattias Gaertner
to Mattias Gaertner

?
?

Mattias Gaertner hat am 24. Januar 2011 um 13:12
geschrieben:

Show quoted text 20 lines
? ? hat am 24. Januar 2011 um 11:57 geschrieben: > > Hi, > > Since the recent font handling changes, some dialogs in the IDE that are > using TSynEdit have become unreadable (font size down to 6 pixels or less). > The query editors of SQLDB for instance. > I want to remedy this by setting the font for these synedit controls to the > same > font as used by the source editor. > > How can I achieve this ? How to obtain the font specs for the source editor > ?? uses SrcEditorIntf; SourceEditorManagerIntf.GetEditorControlSettings(ASynEdit);

?
I added it to the wiki:
http://wiki.lazarus.freepascal.org/Extending_the_IDE#SynEdit ?
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110124/0ab45b87/attachment.html>

Reply by email

Unknown author
to Mattias Gaertner: ? ? Mattias Gaertner hat am 24. Januar 2011 um 13:12 geschrieben: ? I added it to the…
Mattias Gaertner wrote 31 lines
? ? Mattias Gaertner hat am 24. Januar 2011 um 13:12 geschrieben: > ? > ? > > hat am 24. Januar 2011 um 11:57 geschrieben: > >> >> Hi, >> >> Since the recent font handling changes, some dialogs in the IDE that are >> using TSynEdit have become unreadable (font size down to 6 pixels or less). >> The query editors of SQLDB for instance. >> I want to remedy this by setting the font for these synedit controls to the >> same >> font as used by the source editor. >> >> How can I achieve this ? How to obtain the font specs for the source editor >> ?? > uses SrcEditorIntf; > SourceEditorManagerIntf.GetEditorControlSettings(ASynEdit); > ? I added it to the wiki: http://wiki.lazarus.freepascal.org/Extending_the_IDE#SynEdit

Great, thanks.

I just updated, after seeing in the wiki that it seems someone has already done it for the standard SQL for TSQLQuery.

But, as attached screenshot shows, the result is not as I expected. Attached image shows the difference in fonts between the source editor and the SQL property editor.

They are clearly different. I would think that the same font is used ?

Michael.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fonts.png
Type: image/png
Size: 23115 bytes
Desc:
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110124/b8c21b83/attachment-0001.png>

Reply by email

Unknown author
to zeljko
zeljko wrote
> They are clearly different. I would think that the same font is used ? looks like height vs. size mismatch

That may be so, but then the IDE routines are at fault, since they are the only routines used to set the font ?

Michael.

Reply by email

u-boot
to Unknown author: Since the recent font handling changes, some dialogs in the IDE that are using TSynEdit…

Same question here as in irc nobody answered it a few hours ago.

I tried the following lines. It does not work with setfocus before parent changing.
My question is, if it should work in this order or if this is correct behaviour.

procedure TForm1.Button1Click(Sender: TObject);
begin
  edit1.SetFocus;
  if (Edit1.Parent=Panel2) Then Edit1.Parent:=Panel1 else
Edit1.Parent:=Panel2;
end;

Reply by email

Mattias Gaertner
to u-boot

?
?

u-boot hat am 24. Januar 2011 um 17:49 geschrieben:

Show quoted text 15 lines
Same question here as in irc nobody answered it a few hours ago. I tried the following lines. It does not work with setfocus before parent changing. My question is, if it should work in this order or if this is correct behaviour. procedure TForm1.Button1Click(Sender: TObject); begin ? ?edit1.SetFocus; ? ?if (Edit1.Parent=Panel2) Then Edit1.Parent:=Panel1 else Edit1.Parent:=Panel2; end;?

Changing the Parent switches the focus to another control. So, you should set the focus after changing the parent. ?
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110124/6f641bbf/attachment-0001.html>

Reply by email

u-boot
to Mattias Gaertner

I know that the other order works for my simple procedure. I asked because i inspected a bug, that is described in the german forum (http://www.lazarusforum.de/viewtopic.php?f=18&t=4599 <http://www.lazarusforum.de/viewtopic.php?f=18&t=4599>):

following code was tried in Stringgrid1.OnSelectEditor:

procedure TForm1.StringGrid1SelectEditor(Sender: TObject; aCol, aRow: Integer;
  var Editor: TWinControl);
begin
  if (aCol=2) and (aRow>0) then
  begin
    Memo1.Visible:=True;
    Editor:=Memo1;
    Memo1.BoundsRect:=StringGrid1.CellRect(2,aRow);
    Editor.SetFocus;       //!!! here is the focus that doesn't work
  end;
end;
//looking up the selecteditor-proceure:
procedure TCustomGrid.SelectEditor;
var
  aEditor: TWinControl;
begin
  aEditor := GetDefaultEditor(Col);
  if EditingAllowed(FCol) and Assigned(OnSelectEditor) then begin
    // in some situations there are only non-selectable cells
    // if goAlwaysShowEditor is on set initially editor to nil,
    // user can modify this value in OnSelectEditor if needed
    if not SelectCell(FCol,FRow) then
      aEditor:=nil;
    OnSelectEditor(Self, fCol, FRow, aEditor);    //!! here the above procedure with the setfocus is called
  end;
  if aEditorEditor then
     Editor := aEditor;	    //!! here SetEditor is called that contains changing Parent with impact on focus
end;
Show quoted text 34 lines
u-boot hat am 24. Januar 2011 um 17:49 geschrieben: > Same question here as in irc nobody answered it a few hours ago. > > > I tried the following lines. It does not work with setfocus before > parent changing. > My question is, if it should work in this order or if this is correct > behaviour. > > > procedure TForm1.Button1Click(Sender: TObject); > begin > edit1.SetFocus; > if (Edit1.Parent=Panel2) Then Edit1.Parent:=Panel1 else > Edit1.Parent:=Panel2; > end; Changing the Parent switches the focus to another control. So, you should set the focus after changing the parent. Mattias
Show quoted text 8 lines
------------------------------------------------------------------------ -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110125/86bc4270/attachment-0001.html>

Reply by email