Now, all things that I develop with a GUI will have:
Help > About PureBasic

Thanks, djes and Fred, both for sending me the big logo + the "Z" one.djes wrote:Nice !
Here it is:loulou2522 wrote:is-it possible to have the source of thi about box ?
Thanks in advance
Code: Select all
; Current PureBasic information
Global current_version_purebasic$="5.44 LTS"
Global current_release_date_purebasic$="6.Dec.2016"
Code: Select all
; About PureBasic window
;
; V1.0 - 9/FEB/2017
;
Procedure about_purebasic()
If OpenWindow(#WINDOW_ABOUT_PUREBASIC,0,0,320+100+200-15-30-10-10-5,200-50+100+10+3+20+10-10,"About PureBasic",#PB_Window_WindowCentered,WindowID(#WINDOW_MAIN))=#False : MessageRequester("Error", "Can't open a window.") : EndIf
DisableWindow(#WINDOW_MAIN,#True)
; Big logo 407x133 pixels
ImageGadget(#IMAGE_WINDOW_ABOUT_PUREBASIC,10,10,407,130,ImageID(31))
; Z logo 130x130 pixels
ImageGadget(#IMAGE_WINDOW_ABOUT_PUREBASIC_2,GadgetX(#IMAGE_WINDOW_ABOUT_PUREBASIC)+GadgetWidth(#IMAGE_WINDOW_ABOUT_PUREBASIC)+5,10,130,130,ImageID(32))
; Editor Gadget with PureBasic information
EditorGadget(#EDITOR_WINDOW_ABOUT_PUREBASIC,10,GadgetY(#IMAGE_WINDOW_ABOUT_PUREBASIC)+GadgetHeight(#IMAGE_WINDOW_ABOUT_PUREBASIC)+5,407+130-3-2-1,100+10-10,#PB_Editor_ReadOnly)
t$=""
t$+"Coded using PureBasic "+current_version_purebasic$+" - "+current_release_date_purebasic$+#CRLF$
t$+Chr(34)+"Feel the ..Pure.. Power"+Chr(34)+#CRLF$
t$+"© 1998-2017 Fantaisie Software."+#CRLF$
t$+"http://www.purebasic.com"
SetGadgetText(#EDITOR_WINDOW_ABOUT_PUREBASIC,t$)
; OKAY button
ButtonGadget(#BUTTON_WINDOW_ABOUT_PUREBASIC_OKAY,(320+100+200)/2-100+10,20+3+200-40-50+100+10+10+10-10,90,20+2+1,"OK")
; Add keyboard shortcuts
AddKeyboardShortcut(#WINDOW_ABOUT_PUREBASIC,#PB_Shortcut_Escape,1000)
AddKeyboardShortcut(#WINDOW_ABOUT_PUREBASIC,#PB_Shortcut_Return,1003)
; Wait for the user to press the OKAY button
okay=#False
Repeat
event=WaitWindowEvent()
; Pressed the close window gadget (Ubuntu) OR <ENTER> or <ESC>
If (event=#PB_Event_CloseWindow) Or (event=#PB_Event_Menu And EventMenu()=1003) Or (event=#PB_Event_Menu And EventMenu()=1000)
okay=#True
EndIf
Select event
Case #PB_Event_Gadget
Select EventGadget()
; OKAY button
Case #BUTTON_WINDOW_ABOUT_PUREBASIC_OKAY
okay=#True
EndSelect
EndSelect
Until okay=#True
; Close the About window and activate the main window
DisableWindow(#WINDOW_MAIN,#False)
CloseWindow(#WINDOW_ABOUT_PUREBASIC)
EndProcedure
Code: Select all
#WINDOW_ABOUT_PUREBASIC,0,0,320+100+200-15-30-10-10-5,200-50+100+10+3+20+10-10,"About PureBasic"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Simple answer: I code the GUI by eye, which means I add and remove pixels until I get the right size. That is why I take hours to draw simple stuff.Dude wrote:Okay, I think I speak for everyone here when I ask: why the heck do you code your numbers like that?![]()
Code: Select all
#WINDOW_ABOUT_PUREBASIC,0,0,320+100+200-15-30-10-10-5,200-50+100+10+3+20+10-10,"About PureBasic" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Code: Select all
t$+"Coded using PureBasic "+current_version_purebasic$+" - "+current_release_date_purebasic$+#CRLF$
t$+Chr(34)+"Feel the ..Pure.. Power"+Chr(34)+#CRLF$
t$+"© 1998-2017 Fantaisie Software."+#CRLF$
Code: Select all
t$+"Coded using PureBasic "+InsertString(Str(#PB_Compiler_Version), ".", 2)+#CRLF$
t$+Chr(34)+"Feel the ..Pure.. Power"+Chr(34)+#CRLF$
t$+"© 1998-"+Str(Year(Date()))+" Fantaisie Software."+#CRLF$
The built-in form designer would save you those hours. Just use it to size and position the gadgets as desired, then simply cut & paste the auto-generated gadget placements into your code.marcoagpinto wrote:I code the GUI by eye, which means I add and remove pixels until I get the right size. That is why I take hours to draw simple stuff.Code: Select all
#WINDOW_ABOUT_PUREBASIC,0,0,320+100+200-15-30-10-10-5,200-50+100+10+3+20+10-10,"About PureBasic"
Code: Select all
about_purebasic(iParentWinID.i, sMsg.s, bGadgetType.b = 0, iWinColor.i =$6E7E94, iGadgetColor.i = $AEFBF7); Disables parent window & displays About Window. sMsg Adds a small message above the pb message in the editor window
Code: Select all
XIncludeFile "Module_PBAboutInfo.pbi"
UseModule PBAboutInfo
Global Window_0
Global Button_0
Procedure OpenWindow_0(x = 0, y = 0, width = 135, height = 65)
Window_0 = OpenWindow(#PB_Any, x, y, width, height, "AboutPB", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Button_0 = ButtonGadget(#PB_Any, 0, 0, 135, 65, "Press")
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case Button_0
PBAboutInfo::about_purebasic(Window_0, "hello world from Zebbudi.", 1, $FFFFE0, $6BB7BD)
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
OpenWindow_0()
Repeat
event = WaitWindowEvent()
Until Window_0_Events(event) = #False
End