Page 1 of 1

PB LTS 6.0 - #PB_Explorer_NoFiles always added when switching from form view to code

Posted: Tue Jan 03, 2023 4:22 pm
by pamen
Hi
When switching from form view to code view, each time the explorer list gets automatically #PB_Explorer_NoFiles flag, when other flags are used.
This means, that each time one opens the project or file, the flag is added (as PB opens form view first) and obviously after compiling without correcting the designer code no files are shown.
Only on Windows (Linux and Raspberry seem not to add #PB_Explorer_NoFiles, Mac not tested)

Offending line:

Code: Select all

  ListViewMain = ListIconGadget(#PB_Any, 300, 40, 950, 310, "", 34, #PB_ListIcon_MultiSelect | #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_HeaderDragDrop | #PB_ListIcon_AlwaysShowSelection)
Test Form to reproduce the issue:

Code: Select all

;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;

Global Window_0

Global Tree_0, ListViewMain, Panel_0, ExplorerList_Att, WebView_0, Editor_Email, Container_0, ButtonImage_0, Text_Search, Combo_Search, Checkbox_AllFolders, Container_3, String_CC, Text_3, String_TO, Text_2, String_Date, Text_1, String_Subject, String_2, ButtonImage_cert, String_From, String_1


Procedure OpenWindow_0(x = 0, y = 0, width = 1250, height = 770)
  Window_0 = OpenWindow(#PB_Any, x, y, width, height, "NAMH", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
  CreateStatusBar(0, WindowID(Window_0))
  AddStatusBarField(#PB_Ignore)
  StatusBarText(0, 0, "Email Client Loading")
  AddStatusBarField(300)
  StatusBarProgress(0, 1, 0)
  AddStatusBarField(300)
  StatusBarText(0, 2, ".")
  Tree_0 = TreeGadget(#PB_Any, 0, 9, 290, 727, #PB_Tree_AlwaysShowSelection)
  ListViewMain = ListIconGadget(#PB_Any, 300, 40, 950, 310, "", 34, #PB_ListIcon_MultiSelect | #PB_ListIcon_GridLines | #PB_ListIcon_FullRowSelect | #PB_ListIcon_HeaderDragDrop | #PB_ListIcon_AlwaysShowSelection)
  AddGadgetColumn(ListViewMain, 1, "Date", 120)
  AddGadgetColumn(ListViewMain, 2, "From", 120)
  AddGadgetColumn(ListViewMain, 3, "Subject", 220)
  AddGadgetColumn(ListViewMain, 4, "CC", 100)
  AddGadgetColumn(ListViewMain, 5, "TO", 100)
  AddGadgetColumn(ListViewMain, 6, "Size", 60)
  AddGadgetColumn(ListViewMain, 7, "Attachments", 60)
  AddGadgetColumn(ListViewMain, 8, "Signed", 60)
  AddGadgetColumn(ListViewMain, 9, "SignedBy", 80)
  AddGadgetColumn(ListViewMain, 10, "Folder", 100)
  AddGadgetColumn(ListViewMain, 11, "Acc.No", 20)
  Panel_0 = PanelGadget(#PB_Any, 300, 430, 940, 310)
  AddGadgetItem(Panel_0, -1, "HTML")
  ExplorerList_Att = ExplorerListGadget(#PB_Any, 780, 0, 160, 298, "Attachments", #PB_Explorer_NoMyDocuments | #PB_Explorer_BorderLess | #PB_Explorer_AlwaysShowSelection | #PB_Explorer_MultiSelect | #PB_Explorer_GridLines | #PB_Explorer_FullRowSelect | #PB_Explorer_NoFolders | #PB_Explorer_NoParentFolder | #PB_Explorer_AutoSort)
  WebView_0 = WebGadget(#PB_Any, 10, 10, 760, 258, "")
  AddGadgetItem(Panel_0, -1, "Plain text", 0, 1)
  Editor_Email = EditorGadget(#PB_Any, 10, 0, 930, 270, #PB_Editor_ReadOnly | #PB_Editor_WordWrap)
  CloseGadgetList()
  Container_0 = ContainerGadget(#PB_Any, 300, 10, 940, 25)
  ButtonImage_0 = ButtonImageGadget(#PB_Any, 700, 0, 30, 25, 0)
  Text_Search = StringGadget(#PB_Any, 220, 0, 380, 25, "Search")
  Combo_Search = ComboBoxGadget(#PB_Any, 0, 0, 210, 25)
  Checkbox_AllFolders = CheckBoxGadget(#PB_Any, 610, 0, 80, 25, "All Folders")
  CloseGadgetList()
  Container_3 = ContainerGadget(#PB_Any, 300, 360, 950, 70)
  String_CC = StringGadget(#PB_Any, 480, 30, 450, 25, "", #PB_String_ReadOnly | #PB_String_BorderLess)
  SetGadgetColor(String_CC, #PB_Gadget_FrontColor,RGB(0,0,128))
  Text_3 = StringGadget(#PB_Any, 430, 30, 40, 25, "CC:", #PB_String_ReadOnly | #PB_String_BorderLess)
  DisableGadget(Text_3, 1)
  String_TO = StringGadget(#PB_Any, 660, 0, 270, 25, "", #PB_String_ReadOnly | #PB_String_BorderLess)
  SetGadgetColor(String_TO, #PB_Gadget_FrontColor,RGB(0,0,128))
  Text_2 = StringGadget(#PB_Any, 620, 0, 30, 25, "To:", #PB_String_ReadOnly | #PB_String_BorderLess)
  DisableGadget(Text_2, 1)
  String_Date = StringGadget(#PB_Any, 480, 0, 120, 25, "", #PB_String_ReadOnly | #PB_String_BorderLess)
  Text_1 = StringGadget(#PB_Any, 430, 0, 40, 25, "Sent:", #PB_String_ReadOnly | #PB_String_BorderLess)
  DisableGadget(Text_1, 1)
  String_Subject = StringGadget(#PB_Any, 70, 30, 330, 25, "", #PB_String_ReadOnly | #PB_String_BorderLess)
  String_2 = StringGadget(#PB_Any, 10, 30, 50, 25, "Subject:", #PB_String_ReadOnly | #PB_String_BorderLess)
  DisableGadget(String_2, 1)
  ButtonImage_cert = ButtonImageGadget(#PB_Any, 390, 0, 22, 22, 0)
  String_From = StringGadget(#PB_Any, 70, 0, 310, 25, "", #PB_String_ReadOnly | #PB_String_BorderLess)
  String_1 = StringGadget(#PB_Any, 10, 0, 50, 25, "From:", #PB_String_ReadOnly | #PB_String_BorderLess)
  DisableGadget(String_1, 1)
  CloseGadgetList()
EndProcedure

Re: PB LTS 6.0 - #PB_Explorer_NoFiles always added when switching from form view to code

Posted: Sat Jul 05, 2025 4:02 pm
by spikey
Proposed fix in PR #322.

Re: PB LTS 6.0 - #PB_Explorer_NoFiles always added when switching from form view to code

Posted: Sat Jul 05, 2025 8:23 pm
by mk-soft
spikey wrote: Sat Jul 05, 2025 4:02 pm Proposed fix in PR #322.
Too time-consuming.
I looked at the code and have already corrected it. Was an error in the formdesiger in the opensave.pb code
Just need to put the pull request on GitHub :wink:

Pull Request: https://github.com/fantaisie-software/p ... c/pull/321

The patch for the PureBasic IDE for macOS Intel is on my OneDrive. See signature. ;)

Re: PB LTS 6.0 - #PB_Explorer_NoFiles always added when switching from form view to code

Posted: Sat Jul 05, 2025 9:57 pm
by Piero
mk-soft wrote: Sat Jul 05, 2025 8:23 pmfor macOS Intel
:shock: :?

:wink: :lol:

Re: PB LTS 6.0 - #PB_Explorer_NoFiles always added when switching from form view to code

Posted: Sat Jul 05, 2025 10:32 pm
by mk-soft
Piero wrote: Sat Jul 05, 2025 9:57 pm
mk-soft wrote: Sat Jul 05, 2025 8:23 pmfor macOS Intel
:shock: :?

:wink: :lol:
Mac Mini 2018
It will have to (and will) last a long time. The last one with an Intel processor.
A Mac with M4 Pro will have to wait a little longer.
Can compile the IDE with the M(1-4) and make it available (only the IDE)

Re: PB LTS 6.0 - #PB_Explorer_NoFiles always added when switching from form view to code

Posted: Sat Jul 05, 2025 11:02 pm
by Piero
mk-soft wrote: Sat Jul 05, 2025 10:32 pmlast a long time
I have 2009 Macs (and even older…) that still work VERY well
With them, I can do stuff that would be "harder to implement, more time-consuming" on a new Mac
:wink:

Re: PB LTS 6.0 - #PB_Explorer_NoFiles always added when switching from form view to code

Posted: Sun Jul 06, 2025 12:41 pm
by mk-soft
The FormDesigner still had some errors in the assignment of the custom flags.
During testing, I also noticed an error in the ProcedureBrowser, which sporadically led to a crash.

When I'm ready, I'll post a current pull request in GitHub.