Recent

Author Topic: Small questions of a "visitor"  (Read 27109 times)

gjpneac

  • New Member
  • *
  • Posts: 16
Small questions of a "visitor"
« on: July 19, 2012, 11:12:30 am »
Hello,

I finish my week of Lazarus's discovery. I wanted to generate timetables "automatically". With Windows, the display is nice. With Ubuntu, it is "much less" and even the project is unusable because of a display and of an ergonomics defective. Former user of Delphi, I find it annoying.

By exemple : I wanted to use TCalendars with the display of the number of the weeks.
  • First subtlety: it is necessary to correct the value of a key of the registry under Windows to obtain the week right number (correct with Linux). I did not verify with Delphi that I do not use any more for several years.
  • Second subtlety: by compiling the Windows project on Linux, I obtain : TabOrder is not published in class "TCalendar". Obliged to modify  the file.lfm (Not grave but irritating)
  • Third subtlety: with Linux, the column of the weeks does not appear (or incomplete). In my project it is "harmful"

I understood well that it is the fault of the OS widgets . But the result is disappointing. By adapting an old component of Delphi 3 (TCalPnl), I obtain better on Windows and Linux.

Thus I put two questions :
  • The Lazarus "components + Os widgets" which, with the same properties have very different displays in 2 OS, are they numerous ? TCalendar is one. The vertical line spacing of certain other graphics components (TMemo) is other one (to the point that it is ugly). Is not Lazarus confronted here with an unbridgeable limit ?
  • Another solution would seem to be' fpgui' whose examples have good qualities. Why this solution is not enough developed to be really integrated into the IDE ?

I found this forum very reactive and effective and... nice . My 2 questions have not for object to criticize Lazarus. I think that it is an ambitious and magnificent realization. I think simply that the use of the widgets of OS calcifies the result. In your team, some have a solution so ambitious as the rest of your project. Why is not it emphasis?

Regards. Bye.

« Last Edit: July 19, 2012, 11:28:33 am by gjpneac »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Small questions of a beginner
« Reply #1 on: July 19, 2012, 11:35:50 am »
Bonjour. En anglais parce que mon francais n'est pas tres bon ;)

Edit: tre=>tres. Whoopsie. And yes, I don't do accents, too lazy, sorry.

Thanks for trying out Lazarus and glad you like the support ;)

Summary: post your Windows and Ubuntu Lazarus/FPC versions. I think you may have an older version on Ubuntu which shows some bugs.

Long version:
Re first subtlety: modifying the registry to show calendar? I thought ludob showed you a way to do that without having to modify the registry?
Regardless, I think it's a good idea to respect the user's regional settings. If he configure his OS that way, it's his decision which week is which week number, I'd say.
(Exception: multi-country international software for a single organisation. In this case it makes sense to temporarily override the OS selection)

Second subtlety: don't know about that one. May be because your Lazarus version on Linux is too old.... and lacks support for properties that are on your windows version.

Third subtlety: might be because your Linux Lazarus version is too old (i.e. bugs have been fixed since). As you say, it may be a widgetset limitation, don't know. You could try with qt instead of gtk or vice versa.
In these cases, it is good to ask on the forum as you did, if this is a known problem. You could also look through the bugtracker to see if this is a known, open bug. Or perhaps this was an issue that has been fixed in a certain Lazarus release (in which case the bug on the bugtracker should be closed).

Finally, there is also a custom-drawn widgetset that does not use Qt or Gtk. Have a search through the wiki for details; e.g. http://wiki.lazarus.freepascal.org/Roadmap. Haven't used it myself and it looks as if you will need a recent Lazarus version for that.

There have been multiple discussion on why existing widgetsets are used. I think it often boils down to the balance of "native look and feel for all applications - Lazarus and others -  on a platform" versus "same functionality on all platforms for a given Lazarus application". Often, theres is emphasis on the former choice.

Yes, you could use LCL-FPGUI, which is sort of a bridge to use the fpGUI components using LCL (the Lazarus equivalent to the VCL). I myself would look into the customdrawn widgetset first, because lcl-fpgui is dependent on yet another layer, while customdrawn draws things directly, which would make it less error-prone.

By the way, when you post, could you include Lazarus and FPC version as well as operating system, as well as other relevant details - i.e. in this case the widgetset you use? See
http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F
This will help people respond with more precise answers.
« Last Edit: July 19, 2012, 01:16:29 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

KpjComp

  • Hero Member
  • *****
  • Posts: 680
Re: Small questions of a "visitor"
« Reply #2 on: July 19, 2012, 11:54:45 am »
Quote
Re first subtlety: modifying the registry to show calendar? I thought ludob showed you a way to do that without having to modify the registry?

No, he just showed another way to modify the registry,  I did point that out, but I don't think anybody was listening. :( 

Quote
Finally, there is also a custom-drawn

I was wondering about that, but I'm not sure it's got the Calendar widget done.

One solution is just make a calendar widget yourself, it's actually pretty easy to do.  If you require an example I'll see if I can knock something up.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Small questions of a "visitor"
« Reply #3 on: July 19, 2012, 01:19:43 pm »
Well, if there is a published API, why use the registry, which is an implementation detail for that API and can change?

Re Calendar widget: if they haven't got it, I'm sure the customdrawn devs would love to get one. (Note: as I said, haven't used customdrawn so no idea if there actually is such a widget etc).

Let's hear what the OP has to say about his Laz versions though, I suspect an older Laz version may very well be the cause of his problems...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

KpjComp

  • Hero Member
  • *****
  • Posts: 680
Re: Small questions of a "visitor"
« Reply #4 on: July 19, 2012, 02:32:22 pm »
Quote
Well, if there is a published API, why use the registry

Am I not explaining things correctly here?.  It "IS" using the registry.  There is nothing wrong in using the "SetLocaleInfo(" if modify a global users locale is what your wanting to do.  Although it's a bit like modifying a users Local keyboard layout to fit your own programs keyboard handling, not really ideal.  That's why I said if you take this approach, at least give your users a warning.

Ironically ludob responded with this solution, to my comment on there not been a component level way of modifying the Calendar, but not really sure why he did that, as that's certainly isn't it.

I can see 2 solutions to this problem.

1.  Don't use Microsoft's Calendar, create a custom one.
2.  Alter Lazarus Week Numbering to look at this registry and mimic, at least then we have consistency.  The user always still has the option of modifying the IFIRSTWEEKOFYEAR setting.

I personally think option 2 is a good idea, as if the user wants a particular week numbering, they have the option, so it's more flexible.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Small questions of a "visitor"
« Reply #5 on: July 19, 2012, 02:35:52 pm »
Looking at the OP's TabOrder not published problem, I think version difference is indeed the problem.

For the OP to know, LCL uses exactly the same source code for all widgetsets, so difference in properties visibility is very unlikely to happen if your version between platforms matches.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Small questions of a "visitor"
« Reply #6 on: July 19, 2012, 02:42:18 pm »
Also, while looking through the IDE I found the View/Restriction Browser... which handily shows known limitations of controls on various widgetsets.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

KpjComp

  • Hero Member
  • *****
  • Posts: 680
Re: Small questions of a "visitor"
« Reply #7 on: July 19, 2012, 03:08:25 pm »
Actually I have thought of another option.  But it's rather kludgey!!

From what I can gather, It's at the creation time of the Calendar widget that Microsoft checks for this setting.  So in theory temporally changing this to 2, and then setting back should work.   Also if doing this the Application.UpdateFormatSettings would want setting to false, or a WM_SETTINGCHANGE would reset it.  For the same reason you wouldn't use SetLocaleInfo as this would also fire this event off unnecessarily.

Here is an example, also you need do this on the OnShow event, as it appears the component also only updates once made visible.

Code: [Select]
rocedure TForm1.FormShow(Sender: TObject);
var
  c:TCalendar;
  r:TRegistry;
  ov:string;
  vname:string;
//
begin
  r := TRegistry.Create;
  try
    r.RootKey:=HKEY_CURRENT_USER;
    r.OpenKey('\Control Panel\International',false);
    vname := 'iFirstWeekOfYear';
    ov := r.ReadString(vname);
    r.WriteString(vname,'2');
    try
      c := TCalendar.Create(self);
      c.DisplaySettings:=c.DisplaySettings+[dsShowWeekNumbers];
      c.parent := self;
    finally
      r.WriteString(vname,ov);
    end;
  finally
    r.free;
  end;
end;

Doing this, you can actually have different Calender widgets using different Week numbering.

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Small questions of a "visitor"
« Reply #8 on: July 19, 2012, 03:27:25 pm »
MS Calendar may or may not be fit for the LeftToRight world, but for the RightToLeft world it is unacceptable.  It is a LeftToRight control Only.  Also, the last time I checked, maybe a month ago, the CustomDrawn controls had no support for BiDiMode.

I had to write my own and got it working up to a point and then had to leave it for something more urgent.  I was totally amazed when I discovered that ChildSizing handles BiDi flipping!  I still need to get back to work on my BiDi aware Calendar.
Lazarus Trunk / fpc 2.6.2 / Win32

gjpneac

  • New Member
  • *
  • Posts: 16
Re: Small questions of a "visitor"
« Reply #9 on: July 19, 2012, 05:13:22 pm »
Hello,

More precisons : Versions used to realize my tests

  • Linux - Ubuntu 10.04 - Kernel 2.6.32.32-generic- Gnome 2.30.2 - Lazarus 1.1.37083 - FPC 2.6.1- x86_64-linux-gtk2 (2.6.1-120605).
     :o -> No more recent... Also problem. I am obliged to use packages built from sources shnapshot and installed on the notebook of my colleague (Ubuntu 10.04). With my desktop (Ubuntu 12.04-x86_64), impossible to build packages (same sources).
  • Windows 7 Edition intégrale - Service Pack 1 -  Lazarus 1.1-37902 fpc-2.6.1-20120709-win32
-----
2 additional remarks :
  • To install Lazarus1.1-37902 fpc-2.6.1-20120709-win32.exe: 10 minutes
  • To build lazarus_1.1.37083-0_amd64.deb, fpc-src_2.6.1-120605_amd64.deb and fpc_2.6.1-120605_amd64.deb : 30 minutes min.

If it is necessary to synchronize the versions every day, it requires approximately one hour (with components to be reinstalled). You know how long it is necessary to update Eclipse or Netbeans on a computer Windows or Linux ? And we do not realize this operation every day ! And it is automatic ! It is easy to say: "you have to update, synchronize the versions so that it works". But every day you lose one hour to execute this operation.

Pascal (Delphi and Lazarus) is really my preferred. But the guys, you should not stop in the middle of the job ! There are customers behind. And they need efficiency. It means that it is necessary to be competitive.

Regards.



« Last Edit: July 19, 2012, 05:43:00 pm by gjpneac »

Bart

  • Hero Member
  • *****
  • Posts: 5727
    • Bart en Mariska's Webstek
Re: Small questions of a "visitor"
« Reply #10 on: July 19, 2012, 06:26:47 pm »
When I need to synchronize my Lazarus installations (and this is definately not necessary every day) I do an svn up, then a rebuild.
This takes < 3 minutes on Win7 (1 year old laptop) and appr. 10 min on Suse 10 (on a 11 year old (!) Celeron 700 Mhz). No way near the time you report.

Bart

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Small questions of a "visitor"
« Reply #11 on: July 19, 2012, 06:47:22 pm »
Yes, I agree with Bart.
Code: [Select]
svn update
takes usually ~1 minute.

Rebuilding IDE (from command line or from IDE) takes ~ 3 minutes on my Core2Duo @2GHz (3 years old laptop).
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Small questions of a "visitor"
« Reply #12 on: July 20, 2012, 02:23:59 am »
IDE rebuilding benchmark (after installing a component):
In my Core i3 4 GB RAM Kubuntu 12.04 (home): just like restarting it
In my G850 2 GB RAM Windows XP SP 3 (office): 3-5 seconds

For a clean rebuilding:
In my Core i3 4 GB RAM Kubuntu 12.04 (home): 1 minute
In my G850 2 GB RAM Windows XP SP 3 (office): 5-10 minutes

So there must be something wrong if you have computer with such a spec (or near) but can't get near to above number. FYI, my office computer is installed with F-Secure configured with over normal scanning (it even asks me to allow the IDE and the compiler to run on the first try) and everytime the compiler runs the automatic scanner runs (so it should be faster without).

avra

  • Hero Member
  • *****
  • Posts: 2590
    • Additional info
Re: Small questions of a "visitor"
« Reply #13 on: July 20, 2012, 09:00:17 am »
If it is necessary to synchronize the versions every day, it requires approximately one hour...
Have you considered having only one development platform and cross compiling to the other? Cross compiler can be setup manually, but if you want out of the box solution then you can take at Lazarus CodeTyphon edition.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Knipfty

  • Full Member
  • ***
  • Posts: 232
Re: Small questions of a "visitor"
« Reply #14 on: July 20, 2012, 04:38:10 pm »
Hi Avra,

I just looked at CodeTyphon website.  If I understand this correctly, this is like Lazarus on steroids.  Can I install both Lazarus and CT on the same computer?  Are there any downsides to using it?

As it is, I'm still getting my feet wet with Lazarus.

Thanks

Knipfty
64-bit Lazarus 2.2.0 FPC 3.2.2, 64-bit Win 11

 

TinyPortal © 2005-2018