PureBasic logo in all my software

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
marcoagpinto
Addict
Addict
Posts: 940
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

PureBasic logo in all my software

Post by marcoagpinto »

Hello!

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

Image
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PureBasic logo in all my software

Post by djes »

Nice ! :mrgreen:
User avatar
marcoagpinto
Addict
Addict
Posts: 940
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic logo in all my software

Post by marcoagpinto »

djes wrote:Nice ! :mrgreen:
Thanks, djes and Fred, both for sending me the big logo + the "Z" one.
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: PureBasic logo in all my software

Post by Lunasole »

Good idea to leave some reference to extend PB popularity.
I'm not writing programs used by lot of ppl, but anyway will do it wherever possible, probably by "non-tradionally" using one of the fields in a file version block [some field which is always shown in explorer of any Windows version, starting from XP]
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Re: PureBasic logo in all my software

Post by loulou2522 »

is-it possible to have the source of thi about box ?
Thanks in advance
User avatar
marcoagpinto
Addict
Addict
Posts: 940
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic logo in all my software

Post by marcoagpinto »

loulou2522 wrote:is-it possible to have the source of thi about box ?
Thanks in advance
Here it is:

Somewhere at the start of the program:

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

Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: PureBasic logo in all my software

Post by Dude »

Okay, I think I speak for everyone here when I ask: why the heck do you code your numbers like that? :shock:

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"
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: PureBasic logo in all my software

Post by djes »

It's nice to share the source code, thank you :)
User avatar
marcoagpinto
Addict
Addict
Posts: 940
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic logo in all my software

Post by marcoagpinto »

Dude wrote:Okay, I think I speak for everyone here when I ask: why the heck do you code your numbers like that? :shock:

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.
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: PureBasic logo in all my software

Post by Bisonte »

If you change

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$
to

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$
What you get : No global variables and always the right compiler version and copyright year ;)
What you lost : the suffix "LTS" if it's present and the release date of the compiler

Without manual changes....
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
User avatar
marcoagpinto
Addict
Addict
Posts: 940
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic logo in all my software

Post by marcoagpinto »

Both logo images:

1) text: Image

2) Z (transparency): Image
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: PureBasic logo in all my software

Post by TI-994A »

marcoagpinto wrote:

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"
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.
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. :wink:
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! Please visit my YouTube Channel :D
User avatar
Zebuddi123
Enthusiast
Enthusiast
Posts: 794
Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:

Re: PureBasic logo in all my software

Post by Zebuddi123 »

Hi marcoagpinto Hope you dont mind as its a good idea for promoting PB Ive made a module for my own use and will post it here.

Zebuddi.

Just include the module call

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  
ImageImageImage

Example usage:

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

Module_PBAboutInfo.pbi --- Code to large Images included as bin data. download @ https://www.dropbox.com/s/57hr5gcknhl8h ... o.pbi?dl=0
Last edited by Zebuddi123 on Fri Feb 17, 2017 3:12 am, edited 1 time in total.
malleo, caput, bang. Ego, comprehendunt in tempore
User avatar
marcoagpinto
Addict
Addict
Posts: 940
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic logo in all my software

Post by marcoagpinto »

@Zebuddi

It looks fantastic!

I like the text centred!

:twisted:
User avatar
marcoagpinto
Addict
Addict
Posts: 940
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: PureBasic logo in all my software

Post by marcoagpinto »

@Zebuddi

How do I centre the lines in an EditorGadget?

EDIT: I saw your source code and it uses an: #ES_CENTER (but it doesn't come in the PB documentation)
Post Reply