Recent

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

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
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: 3946
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 »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • 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: 4219
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/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
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: 11858
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.

Igor Kokarev

  • Sr. Member
  • ****
  • Posts: 370
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: 9794
  • Debugger - SynEdit - and more
    • 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: 3946
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 »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 14214
  • Probably until I exterminate Putin.
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.....
Specialize a type, not a var.

440bx

  • Hero Member
  • *****
  • Posts: 3946
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 »
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • 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)

440bx

  • Hero Member
  • *****
  • Posts: 3946
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.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

af0815

  • Hero Member
  • *****
  • Posts: 1289
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

  • Hero Member
  • *****
  • Posts: 596
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).

 

TinyPortal © 2005-2018