Form Designer 5.10

You need some new stunning features ? Tell us here.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Form Designer 5.00 beta 3

Post by wilbert »

Warmonger wrote:Why is this exactly hard for you guys to understand. :shock:
The question could be returned. :wink:

When the event procedure would return #True if the window has been close and #False otherwise, you have the freedom to decide what you want to do with that.
You can exit the event loop so the application continues where you can clean up things and let the application end or you can ignore it.
I'm not asking for cleanup procedures.

You seem to think everyone wants an immediate exit when you hit a close window button and that is good coding practice.
There are lots of situations where you want to do other things first before the application closes.
Also when you look at the event, it doesn't even mention exiting the application. It only says that a window has been closed.
You have total freedom when using PureBasic to code a multi window application and you definitely don't want to terminate the application if one of the windows is closed.
On OS X it is even very common an application keeps running after closing all windows. The mail application for example does. You simple reopen a window by clicking the dock icon.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer 5.00 beta 3

Post by Polo »

I use the form designer for the preference window - closing that window will never lead to closing the app, so I don't think putting an "end" anywhere is a good idea as it would limit the loop procedure ability ;)
Warmonger
Enthusiast
Enthusiast
Posts: 156
Joined: Wed Apr 20, 2011 4:24 pm

Re: Form Designer 5.00 beta 3

Post by Warmonger »

wilbert wrote:
Warmonger wrote:Why is this exactly hard for you guys to understand. :shock:
The question could be returned. :wink:

When the event procedure would return #True if the window has been close and #False otherwise, you have the freedom to decide what you want to do with that.
You can exit the event loop so the application continues where you can clean up things and let the application end or you can ignore it.
I'm not asking for cleanup procedures.

You seem to think everyone wants an immediate exit when you hit a close window button and that is good coding practice.
There are lots of situations where you want to do other things first before the application closes.
Also when you look at the event, it doesn't even mention exiting the application. It only says that a window has been closed.
You have total freedom when using PureBasic to code a multi window application and you definitely don't want to terminate the application if one of the windows is closed.
On OS X it is even very common an application keeps running after closing all windows. The mail application for example does. You simple reopen a window by clicking the dock icon.
I got an idea, lets make a close button that doesn't end the program brilliant! I suggest you guys re-read my past few replies and see where your making mistakes. The whole purpose of the exit function is to terminate the program. In which it should End. If you don't have cleanup procedures like most applications don't, then you wont need to change squat. If you do have cleanup or checking procedures you can call them directly above the end and/or remove the end if necessary. Its good practice to use proper functions to handle proper actions. When someone designs a window and goes to copy it into PB and compile it. Then when you run it and click the exit button from that point it should close the application. There is nothing to cleanup, this is what you guys are not understanding. Your taking it from a literal perspective as maybe you should alert the user before closing out and such. But that's not the gist of the moment, as the form designer needs to generate operable code. Making a fully functional basic event loop is the main purpose of the form designer, without custom cleanup code. For those who use it simply backspacing End and adding in your procedure call is a no brainier. And a million times easier then the designer predicting your structures, form layout, etc.
Last edited by Warmonger on Tue Sep 25, 2012 7:44 am, edited 1 time in total.
Its Not A Bug, Its An Undocumented Feature!
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Form Designer 5.00 beta 3

Post by wilbert »

@Warmonger, I have no idea how to respond since you keep repeating yourself.
Apple is a highly valued company so they must be doing something right. I can't imagine they don't know how to code.
So I'll simply explain how the Mail application on OS X behaves.
When you first open it, it opens with a window. When you click the close window button, the window closes but the application keeps running. When a new message arrives, the system wide notification center still alerts you there is a new message and the little badge on the dock icon that tells the amount of unread messages is increased. if you want to read the message, you click the dock icon and a new window is opened. Really quitting the application is done by choosing Quit from the application menu or right clicking the dock icon and choosing the option to terminate the application. All the close window button does is exactly what it says it should do ... close a window.
Warmonger
Enthusiast
Enthusiast
Posts: 156
Joined: Wed Apr 20, 2011 4:24 pm

Re: Form Designer 5.00 beta 3

Post by Warmonger »

wilbert wrote:@Warmonger, I have no idea how to respond since you keep repeating yourself.
Apple is a highly valued company so they must be doing something right. I can't imagine they don't know how to code.
So I'll simply explain how the Mail application on OS X behaves.
When you first open it, it opens with a window. When you click the close window button, the window closes but the application keeps running. When a new message arrives, the system wide notification center still alerts you there is a new message and the little badge on the dock icon that tells the amount of unread messages is increased. if you want to read the message, you click the dock icon and a new window is opened. Really quitting the application is done by choosing Quit from the application menu or right clicking the dock icon and choosing the option to terminate the application. All the close window button does is exactly what it says it should do ... close a window.
Let me explain how you guys keep failing over and over. When you design a form and copy it over to purebasic every function should work by default. With the event loop setup like I said it will be ready for cleanup and close checking procedures! Also ready for the form to work OUT-OF-THE-BOX! which is the most important thing out of them all. Who cares if your application saves data before it ends. That has no credibility here as its IRRELEVANT! When you design a form it should be able to exit right the second the code is generated, it also helps YOU GUYS by typing the case for you. Universality is key!
Its Not A Bug, Its An Undocumented Feature!
Relax Its All Just Ones And Zeros
There Is No Place Like 127.0.0.1 Except ::1
I do things TO my computer, not WITH my computer... I am a nerd.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer 5.00 beta 3

Post by Polo »

Warmonger, this could make sense if the window you're designing is the main window by they are not only one window in one app, we must keep that in mind ;)
luciano
Enthusiast
Enthusiast
Posts: 151
Joined: Wed Mar 09, 2011 8:25 pm

Re: Form Designer 5.00 beta 3

Post by luciano »

@Polo,
just a "cosmetic" thing in the code in the resize routine with toolbar:
note the - - and the + - in resizegadget
;-)

Code: Select all

Procedure ResizeGadgetsWindow_1()
  Protected WindowWidth, WindowHeight
  WindowWidth = WindowWidth(Window_1)
  WindowHeight = WindowHeight(Window_1)
  ResizeGadget(Panel_0, 10, ToolBarHeight(0) + 0, WindowWidth - 20, WindowHeight -  - ToolBarHeight(0) +  - 48)
EndProcedure
Salc
User
User
Posts: 11
Joined: Tue Sep 25, 2012 9:20 am

Re: Form Designer 5.00 beta 3

Post by Salc »

@Polo:

don't know whether someone has detected this already, but when you create a gadget, delete the width or height in the settings box and push enter, the form designer crashes.
Tested with the latest version from your site.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer 5.00 beta 3

Post by Polo »

Cheers Salc for the testing - don't think anyone has reported this before ill check it out tonight! :)
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: Form Designer 5.00 beta 3

Post by jesperbrannmark »

Hi.
Gaetan, love your work! Super.
I have not had that much time to fiddle around with the form designer, I know however it will be a crucial part of my everyday work very soon.
This might be a very stupid question, since I been so busy I might have missed discussion here.. but:
When making a panelgadget, how do you add more tabs?
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Form Designer 5.00 beta 3

Post by Mindphazer »

Salc wrote:@Polo:

don't know whether someone has detected this already, but when you create a gadget, delete the width or height in the settings box and push enter, the form designer crashes.
Tested with the latest version from your site.
I don't have this issue on OS X...
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Form Designer 5.00 beta 3

Post by Kiffi »

Salc wrote:but when you create a gadget, delete the width or height in the settings box and push enter, the form designer crashes.
Confirmed on Windows Vista

Greetings ... Kiffi

// Edit:
Form Designer 5.00 beta 3 wrote:A program error was detected:

Error Message: Invalid memory access
Error Code: -1073741819
Code Address: 5005787
Target Address: 32
Sourcecode line: 941
Sourcecode file: E:\Users\gaetandupont-panon\Documents\gdpcomputing\Purebasic\FormDesigner\mainevents.pb
Last edited by Kiffi on Tue Sep 25, 2012 4:08 pm, edited 1 time in total.
Hygge
luciano
Enthusiast
Enthusiast
Posts: 151
Joined: Wed Mar 09, 2011 8:25 pm

Re: Form Designer 5.00 beta 3

Post by luciano »

@jesperbrannmark,

to add other tabs, just right click and select edit items.
see picture.

Image
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 456
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Form Designer 5.00 beta 3

Post by Mindphazer »

Another issue, but I think it's due to PureBasic :
On a laptop under OS X, Purebasic doesn't consider CRTL-Click as a right-click. You have to use a "reel" two-buttons mouse to do a right-click...
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer 5.00 beta 3

Post by Polo »

luciano wrote:@Polo,
just a "cosmetic" thing in the code in the resize routine with toolbar:
note the - - and the + - in resizegadget
;-)
Fixed, thanks!
Mindphazer wrote:Another issue, but I think it's due to PureBasic :
On a laptop under OS X, Purebasic doesn't consider CRTL-Click as a right-click. You have to use a "reel" two-buttons mouse to do a right-click...
Fixed.
Salc wrote:don't know whether someone has detected this already, but when you create a gadget, delete the width or height in the settings box and push enter, the form designer crashes.
Fixed, I wasn't checking if the width or height was superior to 0! Thanks again!

About the close window issue, basically I added a check for the CloseWindow event, the event procedure will return true until the window is closed (and then will return false). Here is what an empty project code now looks like (with event loop generation on):

Code: Select all

Enumeration #PB_Compiler_EnumerationValue
  #Window_0
EndEnumeration

Procedure InitWindow_0()
  OpenWindow(#Window_0, 0, 0, 600, 400, "", #PB_Window_SystemMenu)
EndProcedure

Procedure Window_0_Events(event)
  Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure

InitWindow_0()

Repeat
  event = WaitWindowEvent()
Until Window_0_Events(event) = #False
jesperbrannmark wrote:Gaetan, love your work! Super.
I have not had that much time to fiddle around with the form designer, I know however it will be a crucial part of my everyday work very soon.
This might be a very stupid question, since I been so busy I might have missed discussion here.. but:
When making a panelgadget, how do you add more tabs?
Cheers! Someone was quicker than I to answer that one ;)
Post Reply