Re: [Lazarus] Labels and Font size

2013-03-18 Thread Sven Barth
Am 18.03.2013 19:58 schrieb "Mattias Gaertner" :
>
> On Mon, 18 Mar 2013 18:50:23 +
> Graeme Geldenhuys  wrote:
>
> > On 2013-03-18 16:39, Jürgen Hestermann wrote:
> > > What I just found is that this is influenced by the Windows font size
settings.
> > > It is "big" on my machine and "normal" on the machine at work.
> > > If I change it to normal on my machine everything looks okay.
> > > Do you mean this too?
> >
> > Yes, that is exactly what I meant.  Kylix (and I believe Delphi) had a
> > DPI setting stored in the form file (*.xfm). This was then used to
> > automatically scale the form and its content if another system had a
> > different DPI value.
>
> That does not work well, because of rounding errors and different
> fonts/themes.

It would at least be nice (if it doesn't exist already) that a readonly
DesignDPI property is added to the forms and frames? For a WinCE
application where I need to support different DPIs I'm hardcoding my own
DPI value into the code, but this will break if a colleague should edit or
add one form/frame on a computer with different DPI settings... So it would
be nice if I could rely on the form/frame telling me in which DPI setting
it was last edited...

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Flávio Etrusco
On Mon, Mar 18, 2013 at 6:51 PM, Juha Manninen
 wrote:
> On Mon, Mar 18, 2013 at 11:41 PM, Flávio Etrusco
>  wrote:
>> I had a patch which fixed alignment problems (I know of) by making the
>> margin calculation virtual and placing the button inside/over the edit
>> bounds (increasing the margin accordingly). I don't think I have it
>> around anymore but the approach was quite simple anyway.
>
> Making margin calculation virtual where? In TCustomEdit?
>
> Does it require code in the widgetset level?
>
> Juha


It was something like this (patch attached).

Best regards,
Flávio


buttonedit.patch
Description: Binary data
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Mattias Gaertner
On Mon, 18 Mar 2013 22:48:08 +0200
Juha Manninen  wrote:

> It is a well known issue that TEditButton aligns wrong.
> 
> In the last note of issue
>   http://bugs.freepascal.org/view.php?id=12155
> Mattias writes :
> "The best solution is to redesign TEditButton as an edit and a button
> in a panel. I started it as proof of concept in
> examples/groupedcontrols.
> This will break all current workarounds, so it will not be done for 1.0. "
> 
> It was discussed at forum:
>   http://lazarus.freepascal.org/index.php/topic,19496.msg115847.html#msg115847
> 
> I would like to know if this "edit and button in a panel" strategy is
> still valid or does it have some hidden traps?

There might be some transparency problems with a TPanel and of course
a TPanel is not a TCustomEdit (inheritance).

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Mattias Gaertner
On Mon, 18 Mar 2013 22:29:34 +
Graeme Geldenhuys  wrote:

> On 2013-03-18 21:59, Juha Manninen wrote:
> > The Panel solution from Mattias
> > does not require widgetset code .
> 
> Correct, but you might find problems with the Lazarus Forms Designer.
> 
> tiOPF's custom components are all "composite components" (panel holding
> other components in place), but Lazarus IDE had a nightmare with them,
> and it was easy to crash the IDE. Things like the embedded components
> could be moved and resized when they shouldn't, embedded components
> could be deleted etc. Those same tiOPF components worked perfectly under
> the Delphi Forms Designer.

Is there a bug report?

> To be fair, I last looked at those composite
> components under Lazarus Form Designer in the 0.9.30 days (and gave up
> due to all the Form Designer bugs), so don't know if the designer has
> improved since then.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Graeme Geldenhuys
On 2013-03-18 21:59, Juha Manninen wrote:
> The Panel solution from Mattias
> does not require widgetset code .

Correct, but you might find problems with the Lazarus Forms Designer.

tiOPF's custom components are all "composite components" (panel holding
other components in place), but Lazarus IDE had a nightmare with them,
and it was easy to crash the IDE. Things like the embedded components
could be moved and resized when they shouldn't, embedded components
could be deleted etc. Those same tiOPF components worked perfectly under
the Delphi Forms Designer. To be fair, I last looked at those composite
components under Lazarus Form Designer in the 0.9.30 days (and gave up
due to all the Form Designer bugs), so don't know if the designer has
improved since then.


Regards,
  - Graeme -


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Juha Manninen
On Mon, Mar 18, 2013 at 11:46 PM, Vojtěch Čihák  wrote:
> ... ButtonOnlyWhenFocus ...
> It should be better to change behaviour: focused: 80 + 20 px; not focused:
> 100px Edit. This is more native since LCL anchoring automatically skips
> invisible components.

Yes, this is better of course. The old behavior was flawed anyways.
Now the idea is to create a better component.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Juha Manninen
On Mon, Mar 18, 2013 at 11:51 PM, Juha Manninen
 wrote:
> Does it require code in the widgetset level?

Ok, my question was stupid.
This obviously needs widgetset code to prevent the text going under the button.
That's why it is not implemented yet. The Panel solution from Mattias
does not require widgetset code .

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Juha Manninen
On Mon, Mar 18, 2013 at 11:41 PM, Flávio Etrusco
 wrote:
> I had a patch which fixed alignment problems (I know of) by making the
> margin calculation virtual and placing the button inside/over the edit
> bounds (increasing the margin accordingly). I don't think I have it
> around anymore but the approach was quite simple anyway.

Making margin calculation virtual where? In TCustomEdit?

Does it require code in the widgetset level?

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Vojtěch Čihák

Hello,
 
I already tried to extend "examples/groupedcontrols" make it 100% compatible 
with current implementation.
Note that instead of TTransparentPanel I used a pure TWinControl. AFAIR the 
difference is that TTransparentPanel
has Canvas (which we don't need here) + some flags of TComponentState.
It works well as a grid cell editor and also all descendant components works 
(TDirectoryEdit, TFileNameEdit, ...).
The only remaining problem is property ButtonOnlyWhenFocus. This property was 
probably NOT implemented for Delphi compatibility.
It is difficult to reach the same behaviour with the new approach.
Let's say Edit is 100px wide and Button 20px (i.e. 120px total).
Currently only Button visibility changes.
New grouped approach requires enlarge on SetFocus and shrink on KillFocus. I 
tried several hacks and reached ~90% success but the code is not very 
staightforward and KISS.
It should be better to change behaviour: focused: 80 + 20 px; not focused: 
100px Edit. This is more native since LCL anchoring automatically skips 
invisible components.
Or leave this property (mark it as "deprecated").
 
So I would like to know if there were some special reason to use 
TransparentPanel and what to do with property ButtonOnlyWhenFocus.
 
Thanks.
 
Vojtech Cihak a.k.a. Blaazen
 
__

Od: "Juha Manninen" 
Komu: Lazarus mailing list 
Datum: 18.03.2013 21:48
Předmět: [Lazarus] TEditButton alignment


It is a well known issue that TEditButton aligns wrong.

In the last note of issue
 http://bugs.freepascal.org/view.php?id=12155 

Mattias writes :
"The best solution is to redesign TEditButton as an edit and a button
in a panel. I started it as proof of concept in
examples/groupedcontrols.
This will break all current workarounds, so it will not be done for 1.0. "

It was discussed at forum:
 http://lazarus.freepascal.org/index.php/topic,19496.msg115847.html#msg115847 


I would like to know if this "edit and button in a panel" strategy is
still valid or does it have some hidden traps?
I don't see any problem with it myself.
Then it could be implemented in trunk.

The only philosophical problem might be that it doesn't use the
corresponding native widgetset control even if there was one.
Not all widgetsets have it.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TEditButton alignment

2013-03-18 Thread Flávio Etrusco
On Mon, Mar 18, 2013 at 5:48 PM, Juha Manninen
 wrote:
> It is a well known issue that TEditButton aligns wrong.
>
> In the last note of issue
>   http://bugs.freepascal.org/view.php?id=12155
> Mattias writes :
> "The best solution is to redesign TEditButton as an edit and a button
> in a panel. I started it as proof of concept in
> examples/groupedcontrols.
> This will break all current workarounds, so it will not be done for 1.0. "
>
> It was discussed at forum:
>   http://lazarus.freepascal.org/index.php/topic,19496.msg115847.html#msg115847
>
> I would like to know if this "edit and button in a panel" strategy is
> still valid or does it have some hidden traps?
> I don't see any problem with it myself.
> Then it could be implemented in trunk.
>
> The only philosophical problem might be that it doesn't use the
> corresponding native widgetset control even if there was one.
> Not all widgetsets have it.
>
> Juha

I had a patch which fixed alignment problems (I know of) by making the
margin calculation virtual and placing the button inside/over the edit
bounds (increasing the margin accordingly). I don't think I have it
around anymore but the approach was quite simple anyway.

That said, maybe using a panel is the way to go (even if it needs some
work-arounds to make it behave more like a single control to the
developer and incurs a little overhead).

Best regards,
Flávio

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] TEditButton alignment

2013-03-18 Thread Juha Manninen
It is a well known issue that TEditButton aligns wrong.

In the last note of issue
  http://bugs.freepascal.org/view.php?id=12155
Mattias writes :
"The best solution is to redesign TEditButton as an edit and a button
in a panel. I started it as proof of concept in
examples/groupedcontrols.
This will break all current workarounds, so it will not be done for 1.0. "

It was discussed at forum:
  http://lazarus.freepascal.org/index.php/topic,19496.msg115847.html#msg115847

I would like to know if this "edit and button in a panel" strategy is
still valid or does it have some hidden traps?
I don't see any problem with it myself.
Then it could be implemented in trunk.

The only philosophical problem might be that it doesn't use the
corresponding native widgetset control even if there was one.
Not all widgetsets have it.

Juha

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Labels and Font size

2013-03-18 Thread Graeme Geldenhuys
On 2013-03-18 18:58, Mattias Gaertner wrote:
> 
> That does not work well, because of rounding errors and different
> fonts/themes.

I used it for years (at least with CLX, and especially so under Linux
where each system's dpi value could be different - though these days
Linux seem to default to 96 - which I consider bad practice). Anyway,
for years I had no problems with the scaling ability.


> Yes, layout managers are a solution, although IMO "great ease" is an
> exaggeration.

Qt and Java makes it dead simple, and yes I consider that "with great ease".


@Jurgen:
Here is the wiki page I remember seeing.
   http://wiki.freepascal.org/High_DPI


Regards,
  - Graeme -


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Labels and Font size

2013-03-18 Thread Mattias Gaertner
On Mon, 18 Mar 2013 18:50:23 +
Graeme Geldenhuys  wrote:

> On 2013-03-18 16:39, Jürgen Hestermann wrote:
> > What I just found is that this is influenced by the Windows font size 
> > settings.
> > It is "big" on my machine and "normal" on the machine at work.
> > If I change it to normal on my machine everything looks okay.
> > Do you mean this too?
> 
> Yes, that is exactly what I meant.  Kylix (and I believe Delphi) had a
> DPI setting stored in the form file (*.xfm). This was then used to
> automatically scale the form and its content if another system had a
> different DPI value.

That does not work well, because of rounding errors and different
fonts/themes.

 
> Incidentally, this is also why popular toolkits like GTK2+, Qt and Java
> have layout managers - the prevent such dip issues with great ease.

Yes, layout managers are a solution, although IMO "great ease" is an
exaggeration.
 
> How this is handled in LCL is beyond me. I think I say a article in the
> wiki, where somebody developed 2-3 functions ScaleDpi() etc that helps
> with this problem. It wasn't perfect, but much better than nothing.


Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Labels and Font size

2013-03-18 Thread Graeme Geldenhuys
On 2013-03-18 16:39, Jürgen Hestermann wrote:
> What I just found is that this is influenced by the Windows font size 
> settings.
> It is "big" on my machine and "normal" on the machine at work.
> If I change it to normal on my machine everything looks okay.
> Do you mean this too?

Yes, that is exactly what I meant.  Kylix (and I believe Delphi) had a
DPI setting stored in the form file (*.xfm). This was then used to
automatically scale the form and its content if another system had a
different DPI value.

Incidentally, this is also why popular toolkits like GTK2+, Qt and Java
have layout managers - the prevent such dip issues with great ease.

How this is handled in LCL is beyond me. I think I say a article in the
wiki, where somebody developed 2-3 functions ScaleDpi() etc that helps
with this problem. It wasn't perfect, but much better than nothing.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Labels and Font size

2013-03-18 Thread Kostas Michalopoulos
Using the anchor editor is a more lightweight and flexible approach than
using nested panels. You only need nested panels for very complex layouts.
The only problem is the anchor editor itself obscures the form you're
editing more often than not - i'd prefer to see anchor editing to be done
inside the form editor (possibly with the help of small context-sensitive
popups like those in Visual C#'s form editor) instead of using a big
separate window.

(btw in case you haven't used anchor editor, it isn't the same as editing
the anchors property in the object inspector - it something way more
flexible and configurable that i wish all GUI toolkits had)


On Mon, Mar 18, 2013 at 6:27 PM, Alexsander Rosa
wrote:

> You must design the UI taking multi-platform in account.
> Default font is a safe bet; other fonts may be missing in some setup.
> Use autosize and nested panels to make sure the widgets don't get cropped.
> http://port2laz.blogspot.com.br/2012/02/new-screenshots.html
>
>
> 2013/3/18 Jürgen Hestermann 
>
>>
>> Am 2013-03-15 19:14, schrieb Avishai:
>>
>>  Have you specified a Font.Name and Font.Size?  If not, it will use the
>>> default Font for the system it is running on.
>>>
>>
>> No, I have used it with default font settings (I wasn't aware that this
>> will not work).
>> Can I be sure that a predefined font is available on all machines the
>> program will be run on?
>>
>>
> --
> Atenciosamente,
> Alexsander da Rosa
>
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Labels and Font size

2013-03-18 Thread Alexsander Rosa
You must design the UI taking multi-platform in account.
Default font is a safe bet; other fonts may be missing in some setup.
Use autosize and nested panels to make sure the widgets don't get cropped.
http://port2laz.blogspot.com.br/2012/02/new-screenshots.html

2013/3/18 Jürgen Hestermann 

>
> Am 2013-03-15 19:14, schrieb Avishai:
>
>  Have you specified a Font.Name and Font.Size?  If not, it will use the
>> default Font for the system it is running on.
>>
>
> No, I have used it with default font settings (I wasn't aware that this
> will not work).
> Can I be sure that a predefined font is available on all machines the
> program will be run on?
>
>
-- 
Atenciosamente,
Alexsander da Rosa
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Labels and Font size

2013-03-18 Thread Jürgen Hestermann


Am 2013-03-15 19:14, schrieb Avishai:

Have you specified a Font.Name and Font.Size?  If not, it will use the default 
Font for the system it is running on.


No, I have used it with default font settings (I wasn't aware that this will 
not work).
Can I be sure that a predefined font is available on all machines the program 
will be run on?

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus



Re: [Lazarus] Labels and Font size

2013-03-18 Thread Jürgen Hestermann


Am 2013-03-15 20:05, schrieb Graeme Geldenhuys:

On 2013-03-15 17:43, Jürgen Hestermann wrote:

I often have the problem that label text looks fine on one system but when
starting the same program on another machine the font is suddenly huge and text

This sounds like a classic DPI issue. One system having 96 dpi, and the
other maybe 74 or 120 etc.

What DPI setting did you design your forms in?




Sorry for the late answer, I was away from any computer for 2 days.

I am not sure I understand what you mean.
What I just found is that this is influenced by the Windows font size settings.
It is "big" on my machine and "normal" on the machine at work.
If I change it to normal on my machine everything looks okay.
Do you mean this too?
If that's the reason then how is it possible to create graphical UI that look 
correct in all cases?
I don't know which Windows setting someone will have if he uses my program.
So the "write once, compile anywhere" is not even valid for one single OS. ;-)



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Labels and Font size

2013-03-18 Thread waldo kitty


sending this again since the list was down...

On 3/15/2013 14:05, Graeme Geldenhuys wrote:

On 2013-03-15 17:43, Jürgen Hestermann wrote:

I often have the problem that label text looks fine on one system but when
starting the same program on another machine the font is suddenly huge and text


This sounds like a classic DPI issue. One system having 96 dpi, and the
other maybe 74 or 120 etc.


that's exactly what i was thinking but got sidetracked all day and have only
just returned to finish reading the posts :?


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] lazarus has awakened?

2013-03-18 Thread waldo kitty


please ignore...

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Trouble with windows mobile scanner

2013-03-18 Thread Arí Ricardo Ody
I developed an application to run in windows mobile. It remains forgotten for 2 
years. A couple of weeks ago a firm call me asking for this application.

I install it in a Intermec C3Ka1 with windows mobile 6.1 and it ran ok, as 
expected. The surprise appears when I try to read a barcode with the C3Ka1 
built in scanner. It reads the barcode but the result is not showed in the edit 
box component where the focus is.

I installed, in the same handheld, a similar application wrote in .net and the 
scanner read function operate right. If I open the windows mobile note app and 
read a barcode, the content of the barcode is showed in the note app screen 
normally.

I'm sure theat my application operates right with Motorola ES400 and HP 
HX2490(with a and external scanner atached in the handheld slot). When I use 
the scanner with my application in one of these 2 handhelds de scanner function 
operates OK and barcode value is passed to my program appearing in the 
correspondent edit box.

Based on this I ask: What is differente in the Intermec C3Ka1 and Intermec 
CN50? Why my Lazarus application doesn't detect the barcode read?

Do someone of you have idea of what is wrong here? Is there a way of fix the 
problem in the way my application function with these and others(perhaps all) 
hadnhelds running Window Mobile and having scanners?

I'm using: Lazarus 0.9.30 / FPC 2.4.2 / Windows 7 ultimate / sqlite 3

Greetings from São Paulo - Brazil

Ricardo
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Caret is not blinking in Unix

2013-03-18 Thread Mehmet Erol Sanliturk
Dear All ,


On TcustomControl canvas covering all of the form client area , the caret
is NOT blinking in
Unix ( FreeBSD , Fedora ( 17 , 18 ) ) , but it is blinking in Windows .

Lazarus is installed and used as it is without any change .

What can be done to make the caret blinking in Unix ?


Thank you very much .

Mehmet Erol Sanliturk
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Lazarus and Object Pascal training course

2013-03-18 Thread Graeme Geldenhuys
Hi,

I just found this information on Google+ and thought some might be
interested. Every now and then I see somebody post about...where can I
learn about Free Pascal or Lazarus. Maybe this course will help in that.
It consists of 44 online lectures, and the course outline extensive.

  https://www.udemy.com/learn-to-program-with-pascal/



Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Row of the selected field in a dbgrid

2013-03-18 Thread enric
hi.

How can I know a row position in an dbgrig (no the recno the position in
the displayed rows.

Thanks


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus