Page 34 of 45

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 6:51 am
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.

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 6:59 am
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 ;)

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 7:29 am
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.

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 7:44 am
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.

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 7:48 am
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!

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 8:15 am
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 ;)

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 8:44 am
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

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 9:27 am
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.

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 1:41 pm
by Polo
Cheers Salc for the testing - don't think anyone has reported this before ill check it out tonight! :)

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 2:41 pm
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?

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 3:03 pm
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...

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 3:05 pm
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

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 3:12 pm
by luciano
@jesperbrannmark,

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

Image

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 3:57 pm
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...

Re: Form Designer 5.00 beta 3

Posted: Tue Sep 25, 2012 4:36 pm
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 ;)