Lazarus

Installation => General => Topic started by: Igor Kokarev on January 08, 2019, 04:51:45 pm

Title: Show 64-bit or 32-bit in the caption of Lazarus
Post by: Igor Kokarev 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.
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: 440bx 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.)

Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: Bart 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
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: lucamar 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.
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: marcov on January 08, 2019, 07:34:23 pm
inc(lucamar);
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: wp 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.
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: Igor Kokarev 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.
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: Martin_fr 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...


Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: 440bx 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.
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: Thaddy on January 09, 2019, 07:56:06 pm
WHICH LEAVES OUT 16 AND 8 BIT SUPPORT. Really brillant.....
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: 440bx 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.
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: skalogryz 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)
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: 440bx 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.
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: af0815 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


Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: CCRDude 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).
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: Bart on January 10, 2019, 12:09:48 pm
WHICH LEAVES OUT 16 AND 8 BIT SUPPORT. Really brillant.....

Code: Pascal  [Select][+][-]
  1.   {$ifdef CPU8}
  2.     lisLazarusEditorV = 'Lazarus for DOS and CP/M IDE v%s';
  3.   {$endif}
  4.  
  5.   {$ifdef CPU16}
  6.     lisLazarusEditorV = 'Lazarus (16bit) IDE v%s';  //fpc supports win 3.0, so why should'nt we?
  7.   {$endif}
  8.  
  9.   {$ifdef CPU32}
  10.     lisLazarusEditorV = 'Lazarus (32bit) IDE v%s';
  11.   {$endif}
  12.  
  13.   {$ifdef CPU64}
  14.     lisLazarusEditorV = 'Lazarus (64bit) IDE v%s';
  15.   {$endif}
  16.  
  17.   {$ifdef CPU128}
  18.     lisLazarusEditorV = 'Lazarus (128bit) IDE v%s'; //be pro-active!
  19.   {$endif}

Fixed.

Bart
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: tr_escape on January 10, 2019, 03:40:37 pm
Code: Pascal  [Select][+][-]
  1.   {$ifdef CPU128}
  2.     lisLazarusEditorV = 'Lazarus (128bit) IDE v%s'; //be pro-active!
  3.   {$endif}

Fixed.

Bart
[/quote]


 :)
Is there 128bit CPU for normal users? 
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: lucamar on January 10, 2019, 04:20:12 pm
:)
Is there 128bit CPU for normal users?

Not yet but next year ... who knows? :P
Title: Re: Show 64-bit or 32-bit in the caption of Lazarus
Post by: Thaddy on January 10, 2019, 04:42:38 pm
SizeOf(NativeUint) would work a lot better and even with the current compiler.  (and works at compile time)
Code: Pascal  [Select][+][-]
  1. begin
  2. writeln (SizeOf(NativeUint)*8)
  3. end.
All versions tested....<grumpy mode  >:D >:D >
For freaks: of course not complete because it assumes 8 bits per byte....... But anything you throw at it in  FreePascal works...
TinyPortal © 2005-2018