Recent

Author Topic: Show 64-bit or 32-bit in the caption of Lazarus  (Read 3629 times)

Igor Kokarev

  • Jr. Member
  • **
  • Posts: 75
Show 64-bit or 32-bit in the caption of Lazarus
« on: January 08, 2019, 04:51:45 pm »
Hi,

I suggest to display "32-bit" or "64-bit" in the caption of Lazarus.

I work with both versions and switch very often and it's difficult to check if I run the correct version for me.

440bx

  • Hero Member
  • *****
  • Posts: 945
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #1 on: January 08, 2019, 06:05:51 pm »
Hi,

I suggest to display "32-bit" or "64-bit" in the caption of Lazarus.

I work with both versions and switch very often and it's difficult to check if I run the correct version for me.
As a workaround and while you wait for the feature to be added to Lazarus, you can use Process Hacker 2 or Process Explorer (both free downloads).  In Process Hacker ensure you've selected "Bits" as a column, in Process Explorer, under Process Image, select "Image Type". 

That will allow you to quickly check any program's bitness.  Both utilities provide a wealth of information about a process which is often useful when debugging.

HTH.

ETA:  take what follows with a grain of salt since I have not tested it.

It seems that it would be easy to add the feature you've asked for, yourself.  If you open Lazarus.lpi, you'll see "Application.Title := 'Lazarus';".  It would seems that simply changing the title to include the bitness would satisfy your request.  Simply check what the size of a pointer is and, if 8 then append '64bit' to the title, otherwise append "32bit" (or something along those lines.)

« Last Edit: January 08, 2019, 06:31:36 pm by 440bx »
using FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

Bart

  • Hero Member
  • *****
  • Posts: 3452
    • Bart en Mariska's Webstek
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #2 on: January 08, 2019, 06:37:41 pm »
Use {$ifdef CPU32} or {$ifdef CPU64}, no need to check pointersizes.

B.t.w.: I would not like to have that in the caption of in Lazarus.
Especially because it says nothing about the target of the project you have opened in it (it's bitness may very well differ).

Bart

lucamar

  • Hero Member
  • *****
  • Posts: 1803
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #3 on: January 08, 2019, 07:29:30 pm »
I work with both versions and switch very often and it's difficult to check if I run the correct version for me.

Just click: "Help -> About Lazarus" and check the platform in the dialog, as seen in the attached image.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 1.8.4 & 2.0.2 w/FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7229
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #4 on: January 08, 2019, 07:34:23 pm »
inc(lucamar);

wp

  • Hero Member
  • *****
  • Posts: 5832
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #5 on: January 08, 2019, 08:48:01 pm »
I work with both versions and switch very often and it's difficult to check if I run the correct version for me.
Me, too. But I change the color settings of each IDE, I would never look at the title bar. The most-often used IDE (trunk + fpc 3.0.4, 32 bit) has default colors,  the next one (trunk + fpc trunk, 32 bit) has "ocean", another one (trunk + fpc 3.0.4, 64 bit) has "delphi", etc.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Igor Kokarev

  • Jr. Member
  • **
  • Posts: 75
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #6 on: January 09, 2019, 03:55:27 pm »
Thanks for your responses.

About window is too complicated way to check Lazarus version, or use Task Manager / Process Explorer.

I prefer use same color scheme all of versions of Lazarus.

I think that it's very important to easily see Lazarus version (64-bit or 32-bit) in the caption of the window, or in the toolbar.

It seems that it would be easy to add the feature you've asked for, yourself.  If you open Lazarus.lpi, you'll see "Application.Title := 'Lazarus';".  It would seems that simply changing the title to include the bitness would satisfy your request.  Simply check what the size of a pointer is and, if 8 then append '64bit' to the title, otherwise append "32bit" (or something along those lines.)

Thanks, regrettably it doesn't work. It seems that Application.Title is being changed later in the code of Lazarus.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5460
    • wiki
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #7 on: January 09, 2019, 04:33:34 pm »
About color scheme: It does not have to be the entire color scheme. Just adjust the gutter color, or part of it.

There are a lot of diffident bits of info people want to know from the app title.
- current project / directory first/last
- buildmode
- ...

And static info, such as which installation it was run from.

I think the only further acceptable patch (if someone wants to supply it) to add more info to the title would be:
- Include IDE macros
- Allow to specify it on the command line --app-title="lazarus 64 $(LazarusDir) Foo Bar"

I do not think --app-title needs a config entry in the options dialog.
It could be specified inside a lazarus.cfg file in the install dir.

Using --app-title would override the current options (like include project name). Instead IDE macros could be used...



440bx

  • Hero Member
  • *****
  • Posts: 945
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #8 on: January 09, 2019, 07:50:27 pm »
Thanks, regrettably it doesn't work. It seems that Application.Title is being changed later in the code of Lazarus.

I suspected that was going to be the case, that would have been too easy.  Anyway, you can implement that feature very easily yourself.  This is one possibility (it works, I tested it - rather casually though.):
Code: Pascal  [Select]
  1. 1. Locate the file "Lazarusidestrconsts.pas"
  2.  
  3. 2. In that file locate the string "lisLazarusEditorV = 'Lazarus IDE v%s';"
  4.  
  5. 3. comment out that line and add something along the lines of
  6.  
  7.   {$ifdef CPU32}
  8.     lisLazarusEditorV = 'Lazarus (32bit) IDE v%s';
  9.   {$endif}
  10.  
  11.   {$ifdef CPU64}
  12.     lisLazarusEditorV = 'Lazarus (64bit) IDE v%s';
  13.   {$endif}
  14.  
  15. 4. Rebuild the IDE (Tools/Build Lazarus with .... )
  16.  
and you're all set.

The IDE will show (32bit) or (64bit) on the title bar depending on its bitness.

HTH.
« Last Edit: January 09, 2019, 07:53:30 pm by 440bx »
using FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 8175
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #9 on: January 09, 2019, 07:56:06 pm »
WHICH LEAVES OUT 16 AND 8 BIT SUPPORT. Really brillant.....
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.

440bx

  • Hero Member
  • *****
  • Posts: 945
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #10 on: January 09, 2019, 07:57:58 pm »
WHICH LEAVES OUT 16 AND 8 BIT SUPPORT. Really brillant.....
LOL... what's brilliant is to use a program like Lazarus compiled in 8 or 16bit.  That is genuine brilliance.  You outdid yourself this time.

and by the way, the IDE bitness doesn't change the supporting targets.
« Last Edit: January 10, 2019, 01:20:33 am by 440bx »
using FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2180
    • havefunsoft.com
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #11 on: January 10, 2019, 01:41:28 am »
I suggest to display "32-bit" or "64-bit" in the caption of Lazarus.

I work with both versions and switch very often and it's difficult to check if I run the correct version for me.
Consider using "Build Modes"

1. There's an option in IDE to show Build Mode in IDE name
2. You can setup each Build Mode for the particular compiler (and specific compiler setting, if needed)
3. Once you switch between the build modes, IDE header would be updated accordingly.

Naturally you can have as many Build Modes as needed, and in the way you find the most fit ("32-bit", "32-bit-debug", "64-bit", "8-bit"... etc)
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

440bx

  • Hero Member
  • *****
  • Posts: 945
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #12 on: January 10, 2019, 01:50:44 am »
Consider using "Build Modes"

1. There's an option in IDE to show Build Mode in IDE name
2. You can setup each Build Mode for the particular compiler (and specific compiler setting, if needed)
3. Once you switch between the build modes, IDE header would be updated accordingly.

Naturally you can have as many Build Modes as needed, and in the way you find the most fit ("32-bit", "32-bit-debug", "64-bit", "8-bit"... etc)
I didn't ask the question but, that sounds like the ideal solution.
using FPC v3.0.4 and Lazarus 1.8.2 on Windows 7 64bit.

af0815

  • Sr. Member
  • ****
  • Posts: 296
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #13 on: January 10, 2019, 06:21:04 am »
I thinke there are 2 different issues mixed.

One is the IDE itself, is it a 32 or 64 Bit Version. Nothing to do with compiled code.
2nd, the compiled code.

The 2 things are mixed in the thread above.

My 2cents


regards
Andreas

CCRDude

  • Sr. Member
  • ****
  • Posts: 491
Re: Show 64-bit or 32-bit in the caption of Lazarus
« Reply #14 on: January 10, 2019, 07:16:18 am »
I see the "mixing" only in suggesting the obvious: instead of maintaining two different IDEs to compile for two different modes, one IDE with different modes would do. Lazarus is great at cross-compiling (at least in my experience with standard targets Windows, Linux, macOS with different bitness).