Point well taken guys.
@Psychophanta - Nice Addition
@Freak
Heres an example of a for .. next loop from the documentation
Code: Select all
Example 1 :
For k = 0 To 10
...
Next
In this example, the programme will loop 11, time (0 to 10), then quit.
Most people learn by 'example', as you notice the For ... Next loop has nothing in it but defines a for ... next loop very well. If someone were to define a for next loop with this example they could easily do it. If I start adding variables in the middle of the code and even start opening some windows like this example...
Code: Select all
Example 1 :
If OpenWindow(0, 200, 200, 200, 100, #PB_Window_SystemMenu, "Menu Example")
If CreateMenu(0, WindowID()) ; here the menu creating starts....
MenuTitle("Project")
MenuItem(1, "Open" +Chr(9)+"Ctrl+O")
MenuItem(2, "Save" +Chr(9)+"Ctrl+S")
MenuItem(3, "Save as"+Chr(9)+"Ctrl+A")
MenuItem(4, "Close" +Chr(9)+"Ctrl+C")
EndIf
Title$ [, ParentWindowID])
For k = 0 To 10
...
Next
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf
In this example, the programme will loop 11, time (0 to 10), then quit.
That's what I call hacked code, it's someones idea of what they are trying to do, and usually 90% of it is irrelevant for what they are explaining.
If you had no idea what a computer was and I explained that a "Pentium is a computer" (not a lie), and asked you in return what a computer is ? you would reply "a Pentium". It is not a very accurate definition, but nontheless untrue.
So I think my intention is more than accurate and the title of El_Choni's post is "PB Windows MDI template (API bloated)", so I guess his intention was right on the mark. The definition of MDI, is to have child windows within a parent window (without going into detail etc..). One thing you leave out is maybe someone would like to move a MDI window from outside the main window as if it was sliding in ... putting pre-defined limitations on code is not MDI, it is only an addition.
Going through the code in the link to El_Choni's code I found the first 200 Lines of code to have nothing to do with MDI window, so how is his code rock solid ? Anyway no offense to El_Choni on his code, as it is his code and it works for what he wants. Obviously I'm coming from the perspective of someone that simply wan'ts to create an MDI window or even have access to extended window styles. Anyway thanks guys for the feedback as a debate is always welcome.
