GFX_Wizzard_BF - [Modules - All OS]

Share your advanced PureBasic knowledge/code with the community.
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

A new update of the GFX Wizzard BF package was released today. See download in first post.
(Note: For smaller bug-fix releases only the 'actual date' in first post will be updated.)
walbus wrote: Package expanded and optimized.

Since it is often searched for, a new function for color manipulation has now been introduced.
The creation of own color-manipulated pictures, graphics and texts is thereby considerably simplified.
Including three predefined but arbitrarily controllable grayscale converters.
Percent based.

Code: Select all

  ; Change a color - Percent based as floating-point value
  ; Tree grey modes available mode=1, mode=2, mode=3 - mode=1 is more neutral
  Declare Change_Color_BF(color,
                          change_red.f=0,
                          change_green.f=0,
                          change_blue.f=0, 
                          change_contrast.f=0,
                          change_brightness.f=0,
                          change_intensity.f=0,
                          mode_grey=0)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

Next bigger update of the free GFX_Wizzard_BF package is ready - with new functions and demo codes for automatically fitting text in rounded boxes, which could be rotated as well... see the following announcement and screenshots.
Download of the free package as usual - see first post :D
walbus wrote: A new box based text function has been added:

FittedText_RotateRoundBox_Vector_BF

Like all important Wizzard-based text functions, it is also available with the DrawText_BF module (included in the download archive).

There is now a whole range of extended Wizzard-based text functions available, that leave little to be desired.

Almost all these functions are "Box" based.
However, this does not mean that a box is necessary.
A box provides the exact frame for each text output.
Any text is automatically fitted into the given frame.
The customization and formatting of text is extremely simplified.
It only takes minutes to create a sophisticated, even DPI aware, graphical user interface with many texts.
The possibilities go far beyond the usual.
Creating the most sophisticated custom gadgets is possible with minimal effort.

Just have a look at the new demo codes.
There are over 200 different demo codes available in the download archive.
Image
Image
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

A new update of the 'GFX Wizzard BF' package - free to use in your own projects - was released today. See download in first post.
(Note: For smaller bug-fix releases only the 'actual date' in first post will be updated.)
walbus wrote: New additions are the Rectangle Tools BF.
These make it possible to create purely graphically based clickable gadgets.
Almost any graphic effects can be easily inserted into these custom gadgets.
This works on Canvas, Images and PB Sprites.
Graphical backgrounds can be automatically backed up, used and restored.
It also allows gadgets with multiple colors, changing colors or font sizes, gadgets with round corners, and a transparent or semi-transparent background.
ImageGadgets with text on a transparent or semi-transparent background become possible.
Any number of areas can be monitored for mouse entry.
The possibilities are enormous.
Image

Update 11th May 2019:
walbus wrote: Rectangle Tools BF are now complete.
New features have been added.
DPI aware support is now integrated as well.
Currently there are eight different demo codes available which show the possibilities of the rectangle tools.
Image
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Kuron »

Thank you for the update.
User avatar
idle
Always Here
Always Here
Posts: 5049
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by idle »

Keeps getting better and better.
Windows 11, Manjaro, Raspberry Pi OS
Image
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by davido »

Thanks for the updates. :D
DE AA EB
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

@Kuron, idle and davido: Thanks for your comments, you're welcome! :D

The download archive got another small update with a new demo code, which also demonstrates the turned around Z-order of 'rectangle gadgets', which should ease the creation of 'child'-rectangles...

Have fun!
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

Like written before I don't post a news message for every smaller update (just see the 'last update' date in first post)...

But as there are several changes / additions now, here this small news message to inform, that the core module was updated (e.g. the automatic font-size calculation got a massive speedup by factor 10 and more), several examples added or updated and this new en-/decryption module is integrated in the GFX_Wizzard_BF archive. :D

Download link see first post!
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
kinglestat
Enthusiast
Enthusiast
Posts: 732
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by kinglestat »

Should hidegadget work on these modified gadgets?
I tried using it on Progressbargadget() I included a modified demo

Code: Select all


XIncludeFile         "./Progressbar_color_EX.pbi"

; Progressbar professional - Advanced using - Short slider demo ---
CompilerIf #PB_Compiler_IsMainFile
  
  EnableExplicit
  
  ; Workaround Linux PB570 window background color
  CompilerIf #PB_Compiler_OS=#PB_OS_Linux And Not Subsystem("gtk2") And Not Subsystem("qt")
    Macro SetWindowColor(window_ID, color)
      Window_SetCssBackColor(window_ID, color)
   EndMacro
   
    ImportC "" ; By Oma
      gtk_css_provider_load_from_data(*css_provider, data_.p-utf8, length, *error.GError)
      gtk_css_provider_new()
      gtk_style_context_add_provider(*context, *provider, priority)
      gtk_widget_get_style_context(*widget.GtkWidget)
   EndImport
    Procedure Window_SetCssBackColor(Window_ID, color)
      #GTK_STYLE_PROVIDER_PRIORITY_USER=800
      Protected color$, *gProvider=gtk_css_provider_new()
      ; Protected color$="#"+RSet(Hex(color), 6, "000000")
      color$="#"+RSet(Hex(Red(color)), 2, "00")+RSet(Hex(Green(color)), 2, "00")+RSet(Hex(Blue(color)), 2, "00")   
      Protected.s WinBkGndCSS="window.background{background-color: "+color$+";" + #LF$ + "}"
      gtk_css_provider_load_from_data(*gProvider, WinBkGndCSS, -1, #Null)
      gtk_style_context_add_provider(gtk_widget_get_style_context(WindowID(window_ID)), *gProvider, #GTK_STYLE_PROVIDER_PRIORITY_USER)
    EndProcedure
  CompilerEndIf
  
  Enumeration bars : #Bar_0 : EndEnumeration
  
  Define win_event, canvas_ID, font_1_ID, font_2_ID, font_3_ID, resulted_ID, i, flip, i_1, i_2, i_3, i_4, i_5, i_6, i_7, i_8, i_9, back_color=$FF0000
  If Not Defined(PB_ProgressBar_Horizontal , #PB_Constant) : #PB_ProgressBar_Horizontal=0 : EndIf
  
  UsePNGImageDecoder()
  UseJPEGImageDecoder()
  
  Define texture_1_ID=LoadImage(#PB_Any, "./Image_Set/Caisse.png")
  Define texture_2_ID=LoadImage(#PB_Any, "./Image_Set/Background.bmp")
  Define texture_4_ID=LoadImage(#PB_Any, "./Image_Set/Dirt.jpg")
  If Not texture_1_ID : texture_1_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples/3D/Data/Textures/Caisse.png") : EndIf 
  If Not texture_2_ID : texture_2_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples/Sources/Data/Background.bmp") : EndIf
  If Not texture_4_ID : texture_4_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples/3D/Data/Textures/Dirt.jpg") : EndIf 
  
  Define texture_3_ID=CreateImage(#PB_Any, 50, 200, 24, $808080)
  StartDrawing(ImageOutput(texture_3_ID))
  Box(0, 0, 6, 67, $FF) : Box(44, 0, 6, 67, $FF)
  Box(0, 67, 6, 67, $FF00) : Box(44, 67, 6, 67, $FF00)
  Box(0, 134, 6, 67, $FFFF00) : Box(44, 134, 6, 67, $FFFF00)
  StopDrawing()
  
  CompilerIf #PB_Compiler_OS=#PB_OS_Windows : font_1_ID=LoadFont(#PB_Any, "Arial", 11) : CompilerEndIf ; Select a suitable font for each OS
  CompilerIf #PB_Compiler_OS=#PB_OS_Linux   : font_1_ID=LoadFont(#PB_Any, "Arial", 11) : CompilerEndIf
  CompilerIf #PB_Compiler_OS=#PB_OS_MacOS   : font_1_ID=LoadFont(#PB_Any, "Arial", 14) : CompilerEndIf
  
 
  
  OpenWindow(0, #PB_Ignore, #PB_Ignore, 400, 460, "Progressbar EX - Multiple function demo output",
             #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_Invisible)
  
  SetWindowColor(0, back_color)
  AddWindowTimer(0, 1, 64) ; You can change
  AddWindowTimer(0, 2, 3000) ; You can change
  
  ProgressBarGadget(#Bar_0, 70, 55, 250, 25, 0, 100)
  
  
  HideWindow(0, 0)
  i_5=21
  Define Hidden = 0
  
  
  Repeat
    
    If win_event=#PB_Event_Timer And EventTimer()=1
     
      For i=0 To 1 ; Speed up *2
        CompilerIf #PB_Compiler_OS=#PB_OS_MacOS
          SetFrontText_1_EX("Please wait" ,89 ,1, 0, 0, 180, font_1_ID) ; Add text 
        CompilerElse
          SetFrontText_1_EX("Please wait" ,88 ,4, 0, 0, 180, font_1_ID)
        CompilerEndIf
        SetCanvasFlags_EX(#PB_Canvas_Border)
        SetSliderRounding_EX(8, 8)
        ChangeSlider_EX(5, -11) ; Change the slider output pos progressbar #0
        SetGadgetState_EX(#Bar_0, #PB_ProgressBar_Unknown, #PB_ProgressBar_Horizontal, 2, $FF00, $E6E6E6, $FF, 0, $AAAAAA) ; Replace the OS progressbar #0  
      Next
     
    EndIf
    
    If win_event=#PB_Event_Timer And EventTimer()=2
       Hidden = ~Hidden
       
       If Hidden
         HideGadget( #Bar_0, 1 )
       Else
         HideGadget( #Bar_0, 0 )
       EndIf
    EndIf
       
    
    win_event = WaitWindowEvent(1)
   
  Until win_event = #PB_Event_CloseWindow
CompilerEndIf

I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
kinglestat
Enthusiast
Enthusiast
Posts: 732
Joined: Fri Jul 14, 2006 8:53 pm
Location: Malta
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by kinglestat »

Another question; does wizzard work on child windows?
I may not help with your coding
Just ask about mental issues!

http://www.lulu.com/spotlight/kingwolf
http://www.sen3.net
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

With the help of walbus I can give you some answers to your questions. Sorry for the long delay - the GFX_Wizzard package is not mine and was paused for some months. Now I can release an update by walbus...

...but here are the answers of walbus first:
kinglestat wrote:Another question; does wizzard work on child windows?
The Wizzard_BF can of course also work with child windows.
See this demo code in the download package "_MAIN_Dynamic_Developing_Demo_Module_with_GIF_and_MessageRequester_BF" - this code shows the Messagerequester_BF when you press the "Bye" button.
Note: This requester is also a window!
See in the demo code how it is called, it is always the same...
kinglestat wrote:Should hidegadget work on these modified gadgets?
I tried using it on Progressbargadget() I included a modified demo
Hi, look, this is the improved code for the Progressbar_EX code of the Wizzard_BF.
This is very simple, you have to use the canvas ID of this custom bars...

Code: Select all

XIncludeFile         "./Progressbar_color_EX.pbi"

; Progressbar professional - Advanced using - Short slider demo ---
CompilerIf #PB_Compiler_IsMainFile
 
  EnableExplicit
 
  ; Workaround Linux PB570 window background color
  CompilerIf #PB_Compiler_OS=#PB_OS_Linux And Not Subsystem("gtk2") And Not Subsystem("qt")
    Macro SetWindowColor(window_ID, color)
      Window_SetCssBackColor(window_ID, color)
   EndMacro
   
    ImportC "" ; By Oma
      gtk_css_provider_load_from_data(*css_provider, data_.p-utf8, length, *error.GError)
      gtk_css_provider_new()
      gtk_style_context_add_provider(*context, *provider, priority)
      gtk_widget_get_style_context(*widget.GtkWidget)
   EndImport
    Procedure Window_SetCssBackColor(Window_ID, color)
      #GTK_STYLE_PROVIDER_PRIORITY_USER=800
      Protected color$, *gProvider=gtk_css_provider_new()
      ; Protected color$="#"+RSet(Hex(color), 6, "000000")
      color$="#"+RSet(Hex(Red(color)), 2, "00")+RSet(Hex(Green(color)), 2, "00")+RSet(Hex(Blue(color)), 2, "00")   
      Protected.s WinBkGndCSS="window.background{background-color: "+color$+";" + #LF$ + "}"
      gtk_css_provider_load_from_data(*gProvider, WinBkGndCSS, -1, #Null)
      gtk_style_context_add_provider(gtk_widget_get_style_context(WindowID(window_ID)), *gProvider, #GTK_STYLE_PROVIDER_PRIORITY_USER)
    EndProcedure
  CompilerEndIf
 
  Enumeration bars : #Bar_0 : EndEnumeration
 
  Define win_event, canvas_ID, font_1_ID, font_2_ID, font_3_ID, resulted_ID, i, flip, i_1, i_2, i_3, i_4, i_5, i_6, i_7, i_8, i_9, back_color=$FF0000
  If Not Defined(PB_ProgressBar_Horizontal , #PB_Constant) : #PB_ProgressBar_Horizontal=0 : EndIf
 
  UsePNGImageDecoder()
  UseJPEGImageDecoder()
 
  Define texture_1_ID=LoadImage(#PB_Any, "./Image_Set/Caisse.png")
  Define texture_2_ID=LoadImage(#PB_Any, "./Image_Set/Background.bmp")
  Define texture_4_ID=LoadImage(#PB_Any, "./Image_Set/Dirt.jpg")
  If Not texture_1_ID : texture_1_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples/3D/Data/Textures/Caisse.png") : EndIf
  If Not texture_2_ID : texture_2_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples/Sources/Data/Background.bmp") : EndIf
  If Not texture_4_ID : texture_4_ID=LoadImage(#PB_Any, #PB_Compiler_Home+"Examples/3D/Data/Textures/Dirt.jpg") : EndIf
 
  Define texture_3_ID=CreateImage(#PB_Any, 50, 200, 24, $808080)
  StartDrawing(ImageOutput(texture_3_ID))
  Box(0, 0, 6, 67, $FF) : Box(44, 0, 6, 67, $FF)
  Box(0, 67, 6, 67, $FF00) : Box(44, 67, 6, 67, $FF00)
  Box(0, 134, 6, 67, $FFFF00) : Box(44, 134, 6, 67, $FFFF00)
  StopDrawing()
 
  CompilerIf #PB_Compiler_OS=#PB_OS_Windows : font_1_ID=LoadFont(#PB_Any, "Arial", 11) : CompilerEndIf ; Select a suitable font for each OS
  CompilerIf #PB_Compiler_OS=#PB_OS_Linux   : font_1_ID=LoadFont(#PB_Any, "Arial", 11) : CompilerEndIf
  CompilerIf #PB_Compiler_OS=#PB_OS_MacOS   : font_1_ID=LoadFont(#PB_Any, "Arial", 14) : CompilerEndIf
 
 
 
  OpenWindow(0, #PB_Ignore, #PB_Ignore, 400, 460, "Progressbar EX - Multiple function demo output",
             #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_Invisible)
 
  SetWindowColor(0, back_color)
  AddWindowTimer(0, 1, 64) ; You can change
  AddWindowTimer(0, 2, 3000) ; You can change
 
  ProgressBarGadget(#Bar_0, 70, 55, 250, 25, 0, 100)
 
 
  HideWindow(0, 0)
  i_5=21
  Define Hidden = 0
 
 
  Repeat
   
    If win_event=#PB_Event_Timer And EventTimer()=1
     
      For i=0 To 1 ; Speed up *2
        CompilerIf #PB_Compiler_OS=#PB_OS_MacOS
          SetFrontText_1_EX("Please wait" ,89 ,1, 0, 0, 180, font_1_ID) ; Add text
        CompilerElse
          SetFrontText_1_EX("Please wait" ,88 ,4, 0, 0, 180, font_1_ID)
        CompilerEndIf
        SetCanvasFlags_EX(#PB_Canvas_Border)
        SetSliderRounding_EX(8, 8)
        ChangeSlider_EX(5, -11) ; Change the slider output pos progressbar #0 ; TODO - Change next Line - You must get the ID
        resulted_ID=SetGadgetState_EX(#Bar_0, #PB_ProgressBar_Unknown, #PB_ProgressBar_Horizontal, 2, $FF00, $E6E6E6, $FF, 0, $AAAAAA) ; Replace the OS progressbar #0 
      Next
     
    EndIf
   
    If win_event=#PB_Event_Timer And EventTimer()=2
       Hidden = ~Hidden
       If Hidden
         HideGadget( resulted_ID, 1 ) ; TODO - Set here the ID
       Else
         HideGadget( resulted_ID, 0 ) ; TODO - Set here the ID
       EndIf
    EndIf
       
   
    win_event = WaitWindowEvent(1)
   
  Until win_event = #PB_Event_CloseWindow
CompilerEndIf
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

A new update of the GFX_Wizzard package was release today. For download see first post!

Beside several bug-fixes / adjustments on the Wizzard include and an example code there are new functions too:
walbus wrote:There are two new functions to output images and GIF frames.
The output can be done directly to Canvas, PB Sprites, Images and Screen.
With resizing, rotating around the center, rotation offsets, automatic tiling and much more.

"RotateAlphaChannelSprite_BF"
"RotateAlphaChannelSprite_Fast_BF"

Two new demo codes :
"Rotate_Image_with_Alpha_Transparence _on_windowed_screen_1"
"Rotate_Image_with_Alpha_Transparence_1.pb"
Image

Have fun with this free big GFX package! :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Kwai chang caine »

Thanks for the update 8)
ImageThe happiness is a road...
Not a destination
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

A new update of the GFX_Wizzard package was released today. For download see first post!

Here is a little overview of the changes:
walbus wrote: - Functions added to support desktop sizes with any user-settings (scaling and resolution) under Windows OS
- Many demo codes adapted to this
- A special new demo code added: "Desktop_scaling_functions_with_and_without_activated_DPI_aware.pb".
This one works with Wizzard_BF gadgets and shows the window and gadget scaling on a desktop with any scaling settings.
Image

Have fun with this free big GFX package! :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

A new update of the free GFX Wizzard BF package was released today. See download in first post.
(Note: For smaller bug-fix releases only the 'actual date' in first post will be updated.)

Edit (22th Apr. 2020): new archive with bug-fix uploaded

This time regarding the MessageRequester with its many functions...
Image
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply