New checkbox for Tool ProcedureBrowser - display error

Working on new editor enhancements?
PeDe
Enthusiast
Enthusiast
Posts: 284
Joined: Sun Nov 26, 2017 3:13 pm

New checkbox for Tool ProcedureBrowser - display error

Post by PeDe »

I have integrated the functions of the 'Multicolor Procedure List' tool from RSBasic directly into the IDE.
I also added an option with a checkbox to the ProcedureBrowser in the settings. But the checkbox is cut off at the bottom. As a test I added a fifth checkbox, which is not shown.

The container #GADGET_Preferences_ToolSettingsContainer that I think is used has a height of 277 pixels, so there is enough space.
I don't understand where the error is. The dialog is created from an XML file, but I don't see an error there.

Here is a screenshot of Windows 7:
https://www.dreisiebner.at/temp/PB_Mult ... ndows7.png

Here is the code of ProcedureBrowser.pb:

Code: Select all

Procedure ProcedureBrowser_PreferenceCreate(*Entry.ToolsPanelEntry)
  
  Top = 10
  CheckBoxGadget(#GADGET_Preferences_ProcedureBrowserSort, 10, 10, 300, 25, Language("Preferences","ProcedureSort"))
  CheckBoxGadget(#GADGET_Preferences_ProcedureBrowserGroup, 10, 40, 300, 25, Language("Preferences","ProcedureGroup"))
  CheckBoxGadget(#GADGET_Preferences_ProcedureProtoType, 10, 70, 300, 25, Language("Preferences", "ProcedurePrototype"))
  CheckBoxGadget(#GADGET_Preferences_ProcedureMulticolor, 10, 100, 300, 25, Language("Preferences", "ProcedureMulticolor")) ; PeDre
  CheckBoxGadget(#GADGET_Preferences_ProcedureMulticolor2, 10, 130, 300, 25, Language("Preferences", "ProcedureMulticolor")) ; PeDre
  
  GetRequiredSize(#GADGET_Preferences_ProcedureBrowserSort, @Width, @Height)
  Width = Max(Width, GetRequiredWidth(#GADGET_Preferences_ProcedureBrowserGroup))
  Width = Max(Width, GetRequiredWidth(#GADGET_Preferences_ProcedureProtoType))
  Width = Max(Width, GetRequiredWidth(#GADGET_Preferences_ProcedureMulticolor)) ; PeDre
  
  ResizeGadget(#GADGET_Preferences_ProcedureBrowserSort,  10, 10, Width, Height)
  ResizeGadget(#GADGET_Preferences_ProcedureBrowserGroup, 10, 15+Height, Width, Height)
  ResizeGadget(#GADGET_Preferences_ProcedureProtoType,    10, 20+Height*2, Width, Height)
  ; There is a display error. The checkbox is cut off at the bottom. If you make the checkbox higher, it is cut off more. ; PeDre
  ResizeGadget(#GADGET_Preferences_ProcedureMulticolor, 10, 25 + Height * 3, Width, Height) ; PeDre
  ResizeGadget(#GADGET_Preferences_ProcedureMulticolor2, 10, 30 + Height * 4, Width, Height) ; PeDre
  
  Debug("Height = " + GadgetHeight(#GADGET_Preferences_ToolSettingsContainer)) ; = 277
  
  If Backup_ProcedureBrowserSort >= 2
    SetGadgetState(#GADGET_Preferences_ProcedureBrowserSort, 1)
  EndIf
  SetGadgetState(#GADGET_Preferences_ProcedureBrowserGroup, Backup_ProcedureBrowserSort % 2)
  
  SetGadgetState(#GADGET_Preferences_ProcedureProtoType, Backup_DisplayProtoType)
  SetGadgetState(#GADGET_Preferences_ProcedureMulticolor, Backup_ProcedureMulticolor)
  
EndProcedure

Maybe someone has an idea why the checkbox is not displayed correctly.

Peter
Last edited by PeDe on Mon Sep 23, 2024 12:37 pm, edited 1 time in total.
User avatar
chi
Addict
Addict
Posts: 1087
Joined: Sat May 05, 2007 5:31 pm
Location: Austria

Re: New checkbox for Tool ProcedureBrowser - display error

Post by chi »

I bet it's because of the PureScrollAreaChild-height. Here it is 100px on my PC and if I draw a rect over your image it cuts off at 100px as well...
Image
Et cetera is my worst enemy
User avatar
spikey
Enthusiast
Enthusiast
Posts: 769
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: New checkbox for Tool ProcedureBrowser - display error

Post by spikey »

Chi is correct. You need to update 'ProcedureBrowser.pb' around line 583 (on my repo at present but I may not be up to date, I haven't updated lately).
This line:

Code: Select all

AvailablePanelTools()\PreferencesHeight = 100
PeDe
Enthusiast
Enthusiast
Posts: 284
Joined: Sun Nov 26, 2017 3:13 pm

Re: New checkbox for Tool ProcedureBrowser - display error

Post by PeDe »

Hello chi,

thank you, yes that is the error. The ScrollAreaGadget is large enough, but the scroll area is not.

Peter

Preferences.pb:

Code: Select all

ScrollAreaGadget(#GADGET_Preferences_ToolSettingsScrollArea, 0, 0, GadgetWidth(#GADGET_Preferences_ToolSettingsContainer), GadgetHeight(#GADGET_Preferences_ToolSettingsContainer), *CurrentPreferenceToolData\PreferencesWidth, *CurrentPreferenceToolData\PreferencesHeight, 10, #PB_ScrollArea_Single)

Debug("Height = " + *CurrentPreferenceToolData\PreferencesHeight) ; = 100
PeDe
Enthusiast
Enthusiast
Posts: 284
Joined: Sun Nov 26, 2017 3:13 pm

Re: New checkbox for Tool ProcedureBrowser - display error

Post by PeDe »

Hello spikey,

thanks, it's at the very end of the file, I would have searched for a long time.

Peter
User avatar
spikey
Enthusiast
Enthusiast
Posts: 769
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: New checkbox for Tool ProcedureBrowser - display error

Post by spikey »

Glad I could help :)
The good news is that all the tool panel items work more-or-less the same way.
Post Reply