Multicolor Procedure List

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

Multicolor Procedure List 1.2.9 has been released.

Changelog:
  • Added: French.ini (thanks to Mesa)
  • Added: Comments (;-) are grayed out by default.
  • Added: Settings: Procedure_Color, Procedure_BackColor, Comment_Color, Comment_BackColor
  • Optimized: It no longer stutters when moving the PB window.
  • Bugfix: Runtime procedure was not recognized.
  • Bugfix: Procedure name change was not always recognized.

Mesa wrote: Wed Apr 19, 2023 9:41 am Very useful for me, if you want to add a french version, so this is the French.ini file:
I added your language file. Thank you.
AZJIO wrote: Sun Aug 21, 2022 6:17 pm Is it possible to set the label color automatically? For example functions in one color and comments (prefix >) in another color. The current function is the third color.
Done, you can change this color in the Settings.ini.
AZJIO wrote: Sun Aug 21, 2022 6:17 pm The color doesn't work

Code: Select all

HighlightProcedure_BackColor = 16744576
HighlightProcedure_Color = 16744576
The color works. It's purple for me.
If you want to get the color value, please use RGB() in PB.
The color channels in PureBasic are different than anywhere else.
Red color as decimal value in PB: 255
Red color as decimal value in Web: 16711680
Blue color as decimal value in PB: 16711680
Blue color as decimal value in Web: 255
AZJIO wrote: Sun Aug 21, 2022 6:17 pm When moving the window, braking is noticeable. Is it possible to disable the processing of functions when moving the window?
Done
Image
Image
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Multicolor Procedure List

Post by AZJIO »

RSBasic wrote: Fri Sep 01, 2023 8:20 pm Blue color as decimal value in PB: 16711680
Web colors are easier to read and easy to convert.

Code: Select all

Procedure RGBtoBGR(c)
	ProcedureReturn RGB(Blue(c), Green(c), Red(c))
EndProcedure

Procedure ColorValidate(Color$)
	Protected tmp$, tmp2$, i, def
	; 	If IsHex(@Color$) ; валидация через регвыр
	Select Len(Color$)
		Case 6
			def = Val("$" + Color$)
			def = RGBtoBGR(def)
		Case 1
			def = Val("$" + LSet(Color$, 6, Color$))
		Case 2
			Color$ + Color$ + Color$
			def = Val("$" + Color$)
		Case 3
			For i = 1 To 3
				tmp$ = Mid(Color$, i, 1)
				tmp2$ + tmp$ + tmp$
			Next
			def = Val("$" + tmp2$)
			def = RGBtoBGR(def)
	EndSelect
	; 	EndIf
	; 	Debug Hex(def)
	ProcedureReturn def
EndProcedure

Debug  ColorValidate("FF0000")
Debug  ColorValidate("F00")
Debug  ColorValidate("0000FF")
Debug  ColorValidate("00F")
Debug  ColorValidate("00FF00")
Debug  ColorValidate("0F0")
Debug  ColorValidate("333333")
Debug  ColorValidate("333")
Debug  ColorValidate("3")
Debug  ColorValidate("3F3F3F")
Debug  ColorValidate("3F")
Why didn't my function color change?

Code: Select all

HighlightProcedure_BackColor = 3355443
HighlightProcedure_Color = 65535
HighlightComment_Color ?
What if we take these colors from the IDE?
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

AZJIO wrote: Sat Sep 02, 2023 3:23 am Why didn't my function color change?

Code: Select all

HighlightProcedure_BackColor = 3355443
HighlightProcedure_Color = 65535
Have you restarted PureBasic IDE after change? Multicolor Procedure List settings file is read only once at startup.
Image
Image
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Multicolor Procedure List

Post by AZJIO »

Yes, many times over several days.
https://i.imgur.com/sI56wqk.png
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

Multicolor Procedure List 1.3.0 has been released.

Changelog:
  • Changed: If the comment color is not defined in ProcedureColors.ini (value is 0), then the comment color is apply of PureBasic.
  • Bugfix: If the cursor is outside a procedure, then not all colors have been set.
  • Bugfix: If the cursor is inside a module but outside a procedure, then only the module name is displayed.
  • Bugfix: Custom colors now have higher priority than other colors.
  • Added: Hex colors are now supported, e.g. #ff0000, #ccc
  • Added: Language "Russian", thanks AZJIO
  • Bugfix: Language could not be changed in Settings.ini.

AZJIO wrote: Sat Sep 02, 2023 3:23 am What if we take these colors from the IDE?
Done
If you want to use the comment color from the IDE, please set the "Comment_Color" entry in ProcedureColors.ini to 0.
AZJIO wrote: Sat Sep 09, 2023 2:32 pm Yes, many times over several days.
https://i.imgur.com/sI56wqk.png
I used your colors and it looks like this:
Image

It's strange why it doesn't work for you.
AZJIO wrote: Sat Sep 02, 2023 3:23 am Web colors are easier to read and easy to convert.
I added this function. Thank you.
If you want to use hex colors, write: #ff0000 or #ccc
AZJIO wrote: Sun Aug 21, 2022 6:17 pm Language selection doesn't work

Code: Select all

Language = Russian.ini
Done
Is it displayed correctly for you?
Image
Image
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Multicolor Procedure List

Post by AZJIO »

I figured out my problem. My settings file is located in "PureBasic 6.02 x86\Tools\Multicolor_Procedure_List\Data\Settings.ini". This happened before, on the old version. Now I have renamed Settings.ini and a new file is not created. I changed the settings and restarted PureBasic and I see that the settings are saved. I started looking for settings in "AppData\Roaming" looked for the folder "AppData\Roaming\Multicolor Procedure List" and looked at the folder "AppData\Roaming\PureBasic" and accidentally saw the RSBasic folder (AppData\Roaming\RSBasic\Multicolor Procedure List)

It would be nice to add another “Open settings file” button, then the user would not have to search for its location. By the way, since there are a lot of buttons, you can make the first button as a menu button with three Chr bars ($2630), and add secondary functionality there. I have a normal width of 4-6 buttons, the rest are most often outside the window. We don’t often need the “About” and “Exit” buttons. Buttons numbered 3, 4, 5 (auto-select, move, expand) are usually configured once, then the user forgets about them. They can be done in the menu with checkboxes. Function color settings are important; they can be done first. They can be used to mark functions that you are actively working with, or to mark minor functions, such as "include" ones, that are ideal and complete.

Could the ;-GUI comments that appear as ">GUI" be the same color as the comments in the IDE? This is not the case now. Also I would like the procedures to be displayed in the same color as in the IDE. This is not the case now.
Look at my screenshot, the procedures are a little blue (#AAA6DB), and the comments are green (#71AE71). This is not the case in the list of procedures; everything is there in one colorless color.
Comment_Color = #71AE71 - it works
Procedure_Color = #AAA6DB - this does not work
Procedure_Color = 65535 - works, but paints over both procedures and comments
Procedure_BackColor = 65535 - works, but paints over both procedures and comments

The ">GUI" tags do not become active. Is it possible to make it so that if the cursor is outside the procedure, then the label below which the cursor is located, but before the next label, is highlighted?

This combination colors procedures and comments in the color #AAA6DB
Procedure_BackColor = 0
Comment_Color = 0
Procedure_Color = #AAA6DB
Changed: If the comment color is not defined in ProcedureColors.ini (value is 0), then the comment color is apply of PureBasic.
I can't see it, it's not there. Color from the IDE only works for comments, not procedures.
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

Multicolor Procedure List 1.3.1 has been released.

Changelog:
  • Bugfix: If there are tab characters before "Procedure", it was not recognized.
  • Changed: DPI compiler option is now enabled.
  • Added: Button "Settings"
  • Added: Arrow button for changing the visible settings, because there are now many buttons.
  • Added: If the cursor is in ;-comments, then the entry is also highlighted.
  • Bugfix: Procedure recognition

AZJIO wrote: Sun Sep 10, 2023 7:08 am It would be nice to add another “Open settings file” button, then the user would not have to search for its location.
I added a button to open the setting file.
AZJIO wrote: Sun Sep 10, 2023 7:08 am By the way, since there are a lot of buttons, you can make the first button as a menu button with three Chr bars ($2630), and add secondary functionality there. I have a normal width of 4-6 buttons, the rest are most often outside the window. We don’t often need the “About” and “Exit” buttons. Buttons numbered 3, 4, 5 (auto-select, move, expand) are usually configured once, then the user forgets about them. They can be done in the menu with checkboxes. Function color settings are important; they can be done first. They can be used to mark functions that you are actively working with, or to mark minor functions, such as "include" ones, that are ideal and complete.
I didn't add a hamburger menu, but an arrow button to show the other buttons.
AZJIO wrote: Sun Sep 10, 2023 7:08 am Could the ;-GUI comments that appear as ">GUI" be the same color as the comments in the IDE? This is not the case now.
Since 1.3.0, the comment color is apply of PureBasic. You have to set the "Comment_Color" setting to 0, then my tool will take the color of PureBasic.
AZJIO wrote: Sun Sep 10, 2023 7:08 am The ">GUI" tags do not become active. Is it possible to make it so that if the cursor is outside the procedure, then the label below which the cursor is located, but before the next label, is highlighted?
Done
Image
Image
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Multicolor Procedure List

Post by AZJIO »

RSBasic wrote: Sun Sep 10, 2023 4:44 pm Bugfix: If there are tab characters before "Procedure", it was not recognized.
If the tab is before ;-GUI, then the same problem.

Comment_Color = 0
Procedure_Color = 0
Image


Comment_Color = 0
Procedure_Color = #AAA6DB
Image

When you click the "Open Settings.ini" button, an error message first appears, then the file opens.

Icon for Settings.ini
Image

Thank

In the line "Current: FuncName", now the name needs to be output in UTF16 (#PB_Unicode), since there are UTF8 characters (the label in the comment can be in any language)
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

AZJIO wrote: Sun Sep 10, 2023 5:33 pm When you click the "Open Settings.ini" button, an error message first appears, then the file opens.
It is not an error message, but an hint text.
The hint message says that you should restart PureBasic after the change the settings for the change to take effect.
Image
Image
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Multicolor Procedure List

Post by AZJIO »

RSBasic wrote: Sun Sep 10, 2023 6:19 pm It is not an error message, but an hint text.
This means the program uses English. I replaced the Russian file, and in the English file I have an old file without 3 new lines, but also in Russian.

This is how it works for me (more details)

Code: Select all

Global UserIntLang, *Lang
If OpenLibrary(0, "kernel32.dll")
	*Lang = GetFunction(0, "GetUserDefaultUILanguage")
	If *Lang
		UserIntLang = CallFunctionFast(*Lang)
	EndIf
	CloseLibrary(0)
EndIf

Global Dim Lng.s(0)
Lng(0) = "English.ini"

; If UserIntLang = 1049
; 	Lng(0) = "Russian.ini"
; EndIf

Select UserIntLang
	Case 1031
		Lng(0) = "German.ini"
	Case 1036
		Lng(0) = "French.ini"
	Case 1049
		Lng(0) = "Russian.ini"
EndSelect

Debug Lng(0)
The language should be embedded by default if the file is not found.
Incorrect editing of this file may cause this application to stop working.
The data from the settings file must be checked for correctness before using it. Then the application will always remain in working condition.
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

Multicolor Procedure List 1.3.2 has been released.

Changelog:
  • Bugfix: Comments are also recognized with spaces.
  • Bugfix: Comments are also recognized with tabs.
  • Bugfix: If a text in a language is missing, the original language text is displayed instead.

AZJIO wrote: Sun Sep 10, 2023 5:33 pm
RSBasic wrote: Sun Sep 10, 2023 4:44 pm Bugfix: If there are tab characters before "Procedure", it was not recognized.
If the tab is before ;-GUI, then the same problem.
Fixed
AZJIO wrote: Sun Sep 10, 2023 6:54 pm This means the program uses English. I replaced the Russian file, and in the English file I have an old file without 3 new lines, but also in Russian.
AZJIO wrote: Sun Sep 10, 2023 6:54 pm Icon for Settings.ini
I have already added an icon.
Please replace any new files. Otherwise, e.g. new images that were added will also be missing.
AZJIO wrote: Sun Sep 10, 2023 5:33 pm The language should be embedded by default if the file is not found.
I changed it. If any language text is missing, then the language text in the primary language is displayed instead.
Image
Image
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Multicolor Procedure List

Post by AZJIO »

UTF16 ???

By the way, Russian.ini must be UTF8+BOM otherwise it will be read as ANSI.

In order for everyone to make a language file for themselves, you need to do this:
Language = Detect

Code: Select all

LngFile = Read_Setting_INI()
If LngFile = "Detect"
	UserIntLang = CallFunctionFast(*Lang)
EndIf
Or

Code: Select all

LngFile = Str(UserIntLang) + ".ini"
If FileSize(LngFile) = -1
	Read_Setting_INI()
EndIf
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

Multicolor Procedure List 1.3.3 has been released.

Changelog:
  • Bugfix: Language files are now in the correct encoding format.

AZJIO wrote: Sun Sep 10, 2023 7:51 pm UTF16 ???

By the way, Russian.ini must be UTF8+BOM otherwise it will be read as ANSI.
Thank you for the tip. I changed the files.
Image
Image
AZJIO
Addict
Addict
Posts: 2143
Joined: Sun May 14, 2017 1:48 am

Re: Multicolor Procedure List

Post by AZJIO »

What if instead of restarting the IDE, you restarted the "Multicolor Procedure List"? Embed a small exe file into the program, which, when you click the "Restart" button, is extracted into the %Temp% folder, waits 3 seconds and launches the "Multicolor Procedure List". The path to the "Multicolor Procedure List" is passed to it as a parameter. Still, restarting the IDE is not always convenient; there are several open new files that need to be decided whether to save or delete, and if 20 files are open, then time is wasted opening them. Even just testing the flags requires restarting the IDE ten times.
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Multicolor Procedure List

Post by RSBasic »

Multicolor Procedure List 1.3.4 has been released.

Changelog:
  • Changed: Scintilla code is now no longer read as Ascii, but as UTF8.
  • Changed: After changing Settings.ini, the tool will be restarted.

AZJIO wrote: Sun Sep 10, 2023 7:51 pm UTF16 ???
Fixed
AZJIO wrote: Mon Sep 11, 2023 8:32 am What if instead of restarting the IDE, you restarted the "Multicolor Procedure List"?
Done
I changed the MessageBox text to:
The application settings file will now open.
Incorrect editing of this file may cause this application to stop working.
If you have changed a setting, please exit the Windows program "Notepad".
This tool program will then automatically restart for the change to take effect.
After that Notepad will open and when Notepad exits then my tool will restart.
Please replace all files with the new files if you want to use the new version.
Image
Image
Post Reply