Ideas for improvement

You need some new stunning features ? Tell us here.
Axolotl
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Dec 31, 2008 3:36 pm

Ideas for improvement

Post by Axolotl »

Hi there,
when creating interfaces for windows desktop apps with the help of FD, I always have to make changes to the code. Which is notoriously difficult, because the designer overwrites the changed code. (For this I have a solution called copy&paste).
Now I have the following small ideas, which may be easy to add without breaking the concept.

1: Add a freely editable 'Flag' Field to the properties section of the windows and gadgets
The results as they appear in the code view in the form of examples
(a) OpenWindow(..)
-> OpenWindow(1, 10, 10, 80, 80, "Title", #PB_Window_Borderless|#PB_Window_Invisible|#WS_CHILD|#WS_CLIPCHILDREN)
.. Content in the 'Flag' Field: #WS_CHILD|#WS_CLIPCHILDREN
(b) Gadgets(..)
-> ListViewGadget(1, 10, 10, 200, 200, #LBS_NOSEL)
.. Content in the 'Flag' Field: #LBS_NOSEL
-> StringGadget(2, 9, 52, 339, 20, "", #ES_MULTILINE|#ES_AUTOVSCROLL)
.. Content in the 'Flag' Field: #ES_MULTILINE|#ES_AUTOVSCROLL

The entries do not have to be checked, but simply inserted.


2: Could it be possible to process the gadget positioning a little bit more flexible
Use of variables like FormWidth and FormHeight for something like this:
-> TextGadget(#PB_ANY, FormWidth/2-80, 10, 80, "Only an Example.")


3: Naming of Variables and Caption
In addition to the name of the variable, the caption should also be assigned a default text. The name of the variable could be used.
Variable : Button_0
Caption : <>

My Expectation (underscore is not the point)
Variable : Button1 ;' or Button_1
Caption : Button1 ;' Button_1


4: Duplicate Gadgets by Ctrl+C Ctrl+V
When creating duplicates using Ctrl+C and Ctrl+V, the new elements are named like this.
Variable : Button_0
Variable : Button_0_Copy1
Variable : Button_0_Copy1_Copy2

A "nicer" notation might be:
Variable : Button1
Variable : Button2
Variable : Button3


I could probably do this myself, because the IDE is open source (OSS). Unfortunately, my skills are not sufficient for this.
Furthermore, I would be interested to know if there is a need for such improvements at all, or if everyone has and uses their own approach.

Happy coding and Stay healthy.
Mostly running PureBasic <latest stable version and current alpha/beta> (x64) on Windows 10 Home
User avatar
TI-994A
Addict
Addict
Posts: 2490
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore

Re: Ideas for improvement

Post by TI-994A »

Some good suggestions. However, it should be noted that the Form Designer is meant for creating forms, with sized, positioned, and attributed gadgets. Just as with event processing, all changes, modifications, and other processes should be handled by external code files that call these form files. As for naming conventions, the gadget identifiers are fully customisable within the form properties. But to set captions as variables and then assign them values as well would simply be counter-intuitive.

Just some thoughts.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!
User avatar
Caronte3D
Enthusiast
Enthusiast
Posts: 221
Joined: Fri Jan 22, 2016 5:33 pm
Location: Spain

Re: Ideas for improvement

Post by Caronte3D »

Axolotl wrote:...when creating interfaces for windows desktop apps with the help of FD, I always have to make changes to the code. Which is notoriously difficult, because the designer overwrites the changed code.
Yes! The Form Designer is horrible specially if your program have complex forms that needs changes :cry:
I hope some day this thing becomes better or at least someone does it externally
Axolotl
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Dec 31, 2008 3:36 pm

Re: Ideas for improvement

Post by Axolotl »

@TI-994A:

thanks for your feedback and yes, I know and I agree.

I had the cautious hope that with the opening of the IDE in the direction of OSS a greater activity would arise.
There are some great guys already active and I would like to support more. Unfortunately, wanting is not enough, you also have to be able to do it.

Anyways, I am not a professional software developer.
As I mentioned earlier, I focus on coding Desktop Apps on Windows and just for fun, not to make a living from it.
IMHO you need a (very) good graphical form editor if you want to use PB to create real windows desktop apps.
I understand that PB is an open-platform tool for many different things, and I can't see which way it's going to go.
That's okay with me, because thats the intention from the beginning I guess.
So I work with what's there.

While seeing these different aproaches on visual-, form- or xml- designers I thought that it could be a good idea to ask about improvements on the standard which is shipped with PB.
Mostly running PureBasic <latest stable version and current alpha/beta> (x64) on Windows 10 Home
Axolotl
Enthusiast
Enthusiast
Posts: 132
Joined: Wed Dec 31, 2008 3:36 pm

Re: Ideas for improvement

Post by Axolotl »

@Caronte3D

thanks for your feedback
I don't think that the right (my) approach is to wait and see.
Unfortunately, my needs are only a fraction of what you can do with PB. (However, this is also the case with DELPHI and Visual Studio).
I also believe that probably not many people write professional windows desktop apps with PB.

In addition, there are currently many new / modern approaches that go away from win32.

I will have a look into the source code of the IDE and tools and see if i understand some of it...
Mostly running PureBasic <latest stable version and current alpha/beta> (x64) on Windows 10 Home
User avatar
HwyStar
User
User
Posts: 99
Joined: Mon Apr 05, 2010 7:13 pm
Location: Reno, Nevada

Re: Ideas for improvement

Post by HwyStar »

I would like to add my thoughts to this post. Maybe this concept will help define another way of doing it?

In Clarion Software we have a built-in form designer that allows us to place our cursor "inside" a block of window code, and by pressing Ctrl+D we are taken into the form designer. It is so simple to use and so fast! The form designer is built into the IDE and writes the code directly into the same file that has the events in it too.

Clarion code, handles the enumeration of the objects by using "?USE" variables that the compiler assigns at compile-time and the programmer can reference by using the "?" character. We don't need to ever use enumeration which is super nice.

Here is some sample code that I put together in about five minutes. I can change the code, using the form designer and it updates the "window structure" for me. I place my cursor anywhere inside of the "WIN" --> "END", press Ctrl+D, and it displays the window for GUI editing.

If PB had this, and a Report GUI formatting tool too (Clarion has this too), I would be in heaven here in PB land. PB is a such a great and powerful language!

If you would like me to provide some screen prints of the GUI, to help foster ideas, I would be happy to provide them. I am not sure if that would violate any copyrights of Clarion software and will think that through some more.

Code: Select all

  PROGRAM
  MAP
  END

!/////////////////////////////////////////////////////////////////////////////
WIN WINDOW('Caption'),AT(,,557,344),GRAY,FONT('MS Sans Serif',8,,FONT:regular)
    LIST,AT(5,9,546,306),USE(?LIST1),FROM(LIST1:Queue)
    BUTTON('&OK'),AT(11,321,35,14),USE(?OkButton),DEFAULT
    BUTTON('&Cancel'),AT(51,321,36,14),USE(?CancelButton),LEFT
  END
!/////////////////////////////////////////////////////////////////////////////
  CODE
  OPEN(WIN) 
  WIN{PROP:XPOS} = GETINI('TEST','XPOS',1,'TEST.INI')
  WIN{PROP:YPOS} = GETINI('TEST','YPOS',1,'TEST.INI')
  ACCEPT
     CASE FIELD()
     OF 0
        CASE EVENT()
        OF EVENT:OpenWindow
        END
     OF ?OkButton
        CASE EVENT()
        OF EVENT:Accepted
        END
     OF ?CancelButton
        CASE EVENT()
        OF EVENT:Accepted
           POST(EVENT:CloseWindow)
        END
     END
  END
  PUTINI('TEST','XPOS',WIN{PROP:XPOS},'TEST.INI')
  PUTINI('TEST','YPOS',WIN{PROP:YPOS},'TEST.INI')
  CLOSE(WIN)
  
"WIN" always equals FIELD() "0".
Post Reply