Designer adds Explorer_No_Files when switching from design to view

Post bugs related to the IDE here
pamen
Enthusiast
Enthusiast
Posts: 193
Joined: Sat Dec 31, 2022 12:24 pm
Location: Cyprus
Contact:

Designer adds Explorer_No_Files when switching from design to view

Post by pamen »

In Windows, PB 6.02/03 (64 or 32 bit, probably on other OSs as well - not tested)

When ExplorerListGadget is created with below flags, Designer adds the flag No_Files as well, when switching to code view, so afterwards nothing is visible, while files should be visible.

Code: Select all

ExplorerList1 = ExplorerListGadget(#PB_Any, 0, 0, 940, 348, "Only Files Explorer", #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)
S.T.V.B.E.E.V.
User avatar
spikey
Enthusiast
Enthusiast
Posts: 769
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Designer adds Explorer_No_Files when switching from design to view

Post by spikey »

Confirmed on 6.02 LTS and 6.03B5. It seems to be the switch back from code to design view which causes the problem. The flag is also set when you open a form file saved without it.

Okay, the problem is caused by extraneous matching in the OpenReadGadgetFlags() procedure, with the root cause being the iValues field in the Gadgets()\Flags() list defined in 'declare.pb'. Some of the #PB_Explorer_* flags appear two or three times in this table but with different iValues, for example #PB_Explorer_NoMyDocuments appears in ExplorerCombo (1 << 2), ExplorerList (1 << 0) and ExplorerTree (1 << 6). The extraneous matching in OpenReadGadgetFlags picks up all the different possible iValues which then causes other flags to be set erroneously when the properties list is updated.
User avatar
spikey
Enthusiast
Enthusiast
Posts: 769
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: Designer adds Explorer_No_Files when switching from design to view

Post by spikey »

Proposed fix in PR #322.
Post Reply