GFX_Wizzard_BF - [Modules - All OS]

Share your advanced PureBasic knowledge/code with the community.
User avatar
Demivec
Addict
Addict
Posts: 4090
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Demivec »

Lord wrote:
Andre wrote:Code "_MAIN_Dynamic_GUI_Developing_Module_with_GIF_BF" updated and enhanced again, the download archive is updated.
...
Same as before. Flickering. Not useable.
Tested with PB5.62(x64) and PB5.70LTSbeta3(x64)
Also flickers a lot for me, tested with Windows 8.1 using PB 5.62(x64 & x86) and PB 5.70LTX beta4(x64 & x86).

Out of 12 gadgets on the demo screen listed above, these are rock steady: #ColorButton_BF_1, #GIF_2, #TextGadget_BF_1, #TextGadget_BF_2;
These flicker slightly: #ImageGadget_BF_1, #ImageGadget_BF_2, #ButtonImageGadget_PB_1, #GIF_1;
These flicker a lot: #EditorGadget_1, #ButtonGadget_1, #ButtonGadget_2, #ButtonGadget_3.
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

Thank you, Demivec, for your feedback! :D

To sum up the flickering problems, it seems like this:
a) Realtime resizing of gadgets and its content according to the window resize by the user works pretty well on Win10 and on MacOS, on Linux (as far as I know) too.
b) The same on older Windows versions (Win7+8 ..) causes flickering problems. This sync problems are OS-specific (it's just not made for realtime-resizing) and can't be solved by the PB code in the GFX_Wizzard module. That's why Werner has added automatic deactivation of this on-the-fly resizing for this OS versions, here the window content will be resized as soon the window resizing is finished by the user.

Furthermore the main module was updated and several new functions were added:

- ImageGadget_Simple_BF
- SetImageGadget_Simple_BF
- SetImageGadget_Simple_Full_BF
These are all functions for fast setting and changing of all ImageGadget_BF parameters for images, GIFs and and DrawText_BF.

- MessageRequesters_BF were optimized and got a new function SetMessageRequester_BF to easily set the position of the custom messagerequester, including centering it on the whole screen or the calling window, or even just only horizontally or vertically.

So codes updated: 19th Dec. 2018
New version of the archive is online. See first post or this direct link.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Lord
Addict
Addict
Posts: 849
Joined: Tue May 26, 2009 2:11 pm

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Lord »

Andre wrote:...
That's why Werner has added automatic deactivation of this on-the-fly resizing for this OS versions, here the window content will be resized as soon the window resizing is finished by the user.
...
So the headline "GFX_Wizzard_BF - [Modules - All OS]" is misleading.
Win10 is not the whole world.
But I think that flickering is not OS immanent.
Image
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

Lord wrote:
Andre wrote:...
That's why Werner has added automatic deactivation of this on-the-fly resizing for this OS versions, here the window content will be resized as soon the window resizing is finished by the user.
...
So the headline "GFX_Wizzard_BF - [Modules - All OS]" is misleading.
Win10 is not the whole world.
But I think that flickering is not OS immanent.
For instance Win 7 has problems with flickering if gadgets get resized in realtime.
Just take a look at other PB codes here in the forum - even if they are well-done and powerful, for example see some comments here.

For testing, if realtime resizing is flickering or not, here is a simple PB test code. It should work on MacOS, Linux and Win10, but causes flickering on older Windows versions (so you can see, that this has nothing to do with the GFX Wizzard code):

Code: Select all

Procedure resizing() : ResizeGadget(1, #PB_Ignore, #PB_Ignore, WindowWidth(1)-20, WindowHeight(1)-20) : EndProcedure
OpenWindow(1, 0, 0, 400, 400, "", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)
EditorGadget(1, 10, 10, 380, 380) :SetGadgetText(1, "Simple code sample"+#LF$+#LF$+"Resize the Window"+#LF$+#LF$+
                                                    "Legacy Win OS flicker"+#LF$+#LF$+"Win10, Linux OS and MaCOS do not flicker")
BindEvent(#PB_Event_SizeWindow, @resizing())
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
And the note "All OS" is of course right, the whole GZX_Wizzard package contains a lot of GFX effects and Gadget functions, the resizing is only one part of it (which works, but not in realtime on older Windows versions).
(PB itself has some differences or not 100% identical command sets between the three supported OS... but no one would really complain about its claim "made/compatible for Windows/MacOS/Linux"!)

More constructive feedback, wishes, suggestions etc. for the GFX_Wizzard author are welcome! :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Rings
Moderator
Moderator
Posts: 1427
Joined: Sat Apr 26, 2003 1:11 am

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Rings »

removed offtopic......
SPAMINATOR NR.1
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

Main module and several example codes got fixes and improvements. Can be found in the updated GFX_Wizzard package.

See first post or direct download here.

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

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

GFX Wizzard package is now completely adapted to PB5.70 (all three OS).

Including the main module and a lot of example codes around 20 included files were updated
(including some Linux-specific workarounds, e.g. for SetWindowColor / GTK problems).

Download see first post or here.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

GFX Wizzard package updated again.

These are more details about the changes / updates:
walbus wrote: The focus of this update lies on the dynamic GUI.

The extended BF gadgets are adapted to the needs of the dynamic GUI.
There are no DPI problems with the BF gadgets and the output of fonts.
The resizing of fonts, images, GIF photos with EXIF data and the use of of the BF Sprite Sheets is now shown in the _Main dynamic Democode.

Progressbars can be integrated as partially transparent overlays, or, as they are otherwise common, directly into the BF ColorButtons, the BF TextGadgets and the BF ButtonImageGadgets, which is also shown in the demo.

GIF, Images, Photos and BF Sprite Sheets can be loaded and displayed.
There is integrated a complete on demand resizable multi function player this.
BF Sprite Sheets are very easy to edit, they offer all needed GIF functions.

The _Main_SpriteTool offers many possibilities to convert GIF to BF Sprite Sheets of any desired size and also to edit them.

Many more optimizations and also new functions were included.

Translated with http://www.DeepL.com/Translator
Download see first post or here.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

While the GFX_Wizzard_BF already got several smaller updates and enhancements (which aren't announcend here each time, just check the 'Last update' date in first post), here is another larger announcement:

When it comes to scaling windows and gadgets (including its content like images and text displays) there are two PB modules working together now - ScaleGadgets by 'mk-soft' and the "Gadgets_BF" in the GFX_Wizzard package by 'walbus'.

Image

Read here the orginal announcement:
Werner 'walbus' Albus wrote:"I am pleased to announce that the outstanding ScaleGadgets module from mk-soft can now work with the GFX_Wizzard_BF.

It is now possible to use the extended Gadgets_BF without restrictions and easy to use with this module together with all PB Gadgets.
Michael (mk-soft) and I were able to realize this together within a very short time.

Not only the result of the cooperation of two coders, but also the possibility of easy data exchange and cooperation between the modules is shown.

The demo code can be found in the GFX_Wizzard_BF archive under the name _ScaleGadgets.pb."
Download see first post or directly here.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

GFX_Wizzard_BF package was updated and got several improvements and new demo codes. Here are the details:
walbus wrote: The Wizzard archive now includes demo codes for easily generating encrypted images and text.
These functions have long been included in the package, but were not described in detail.

They are important in order to protect images and texts of any kind as easily as possible against manipulation.
The Crypter are AES256 based, with automatic and randomized IV.

The Wizzard contains the QAES_Crypter_BF to implement these functions. This is an "OFB mode two stage special crypter", which can handle string termination as well, and easily create encrypted data of any kind.
Download see first post or directly here.

Edit 03/07/2019:
walbus wrote: Furthermore many new functions, also for DPI-aware outputs.

for example:
- DPI_ResizeFactor_BF () for easy customization of gadgets and windows
- Templates and demo codes to create resizeable GUI
- All Gadgets_BF are resizable on-demand and automatically adjust font sizes, text and images.
- ResizeGadget_BF may e.g. scale ImageGadget_BF including image and various backgrounds on-demand.
- SetGadgetText_BF can calculate the required font sizes for PB gadgets on-demand and also insert the text exactly the right way.
- SetCustomText_BF may e.g. Convert any CanvasGadget into a TextGadget or a ColorButton, with many innovative extras and on-demand resizable as well.

The ImageGadget_BF works slightly differently than the PB ImageGadget.
You decide how big the gadget should be, then BF calculates the right image and inserts it. Images and backgrounds are automatically cached and do not have to be redrawn.
Some more descriptions and demo code about the encryption/decryption functions (also included in the package now):

Code: Select all

XIncludeFile("./GFX_Wizzard_BF.pbi")

; Demo - File crypting

;- QAES AES256 OFB mode two stage special crypter for all things - binarys - strings - text files -----

; This crypter can handle automatic string termination for any strings - In compiler mode ASCII and UNICODE !
; The crypter works with all data lengths, also <!6 bytes

; With mode ASCII you can encrypt mixed data, string and binary - This ignore the encryption from zero bytes

; The crypter go ever forward, a extra decrypter is unnecessary !
; You cipher a file blockwise, set ever the current block number (consecutive) with the counter - Important !

; Author Werner Albus - www.nachtoptik.de - www.quick-aes-256.de
; No warranty whatsoever - Use at your own risk

; ; counter.q                : You cipher a file blockwise, set ever the current block number (consecutive numbering) - This is important !
; ;                          : You can set the counter as quad, positive and negative
; ; key$                     : You can use any strings as key
; ; @text$ / @string_result$ : Set a pointer to the source data
; ; @string_result$          : Set the adress to the destination data - Hint : It can also are the same place as the plain data
; ; mode                     : Set mode=0 for binary files - Set mode=1 for ASCII strings - Set mode=2 for UNICODE strings
; 
; ; A sample : QAES_Crypter_BF(mode_ascii_or_unicode, *source_data, *destination_data, length_of_data, key$, counter)
; 
; counter=123456
; string$="The quick brown fox jumps over the lazy dog"
; string$="A"+RSet("Z", 50, "x") ; Demo text string to encryption - For unicode, the length from 1 char = 2 bytes !
; key$="This is a simple key"
; ; mode=2 ; UNICODE
; mode=SizeOf(character)
; 
; ; Encrypting
; QAES_Crypter_BF(mode, @string$, @string$, StringByteLength(string$), key$, counter)
; Debug "QAES Crypter BF : Encrypted : "+string$
; ShowMemoryViewer(@string$,StringByteLength(string$))
; Debug ""
; ; Decrypting
; QAES_Crypter_BF(mode, @string$, @string$, StringByteLength(string$), key$, counter)
; Debug "QAES Crypter_BF : Decrypted : "+string$

;-----------------------------------

path$ = OpenFileRequester("Select a file to encrypting or decrypting !", "", "*.*", 0)
file=OpenFile(#PB_Any, path$)
If file
  *buffer=AllocateMemory(Lof(file))
  ReadData(file, *buffer, MemorySize(*buffer))
  QAES_Crypter_BF(0, *buffer, *buffer, MemorySize(*buffer), "Your key")
  FileSeek(file, 0) : WriteData(file, *buffer, MemorySize(*buffer)) : CloseFile(file)
EndIf
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

Another announcement about this graphics and GUI creation module - free to download and use in your projects! :D

As I've asked for supporting the DynamicDialogs module and for help with the creation of vector-based ColumnCharts and PieCharts, in combination with the powerful GFX functions of the GFX_Wizzard_BF module, the last weeks went by and now we got the result.

See the following screenshots and the detailed description of this update below.

Image
Image
Image
walbus wrote: Now a package with different crypters has been added.

BF does include the QAES universal crypter for already a longer time.
Everything that exists can be encrypted with this crypter.
It even supports string encryption without creating string termination problems.
For Ascii and Unicode.

Based on this crypter has now been added a special image crypter, as well as a file crypter.
Likewise a file crypter with progress bar display and for unlimited file sizes.

All QAES crypters do not create temporary files and are AES256 based.
The handling of these crypters is absolutely easy.


All Gadgets_BF now also support "DPI aware".
The DPI support is activated with the command Activate_DPI_aware_BF (1).

A full DPI support has now been added to the Wizzard too.
There are now mechanisms, demo codes, and functions that can greatly simplify many DPI problems or create dynamic GUI or windows.

The advanced BF text functions and Gadgets_BF support dynamic fonts.
The font size calculation is done automatically.

Additionally a resize factor and text padding x, y can be set.
Text size problems can be eliminated very easily and permanently.

The automatic BF text size calculation works "on demand" and also without activated DPI aware function.

The most important new features:
(Hint: A detailed description of all functions can be found in the BF module "Declare" section)

DPI functions:
Activate_DPI_aware_BF()
GetState_Activate_DPI_aware_BF()
DPI_ResizeFactor_BF()
Deactivate_DPI_ResizeFactor_BF()
GetResolution_DPI_X_BF()
GetResolution_DPI_Y_BF()
GetOS_PPI_BF()

SetCanvasCustomText_BF()
This function converts an existing canvas into a text gadget with many additional functions and automatic text size calculation.
The possibilities go far beyond the usual, e.g. by setting the background color, text center, text right, text vertical, reverse text, RTL text.

FitGadgetText_BF()
Converts the text of any gadget into an exactly matching text.
This is a feature that can magically solve text size issues with gadgets.

SetGadgetText_BF()
These two functions are the universal fix for any PB gadget.
Required text sizes are calculated automatically, with adjustable padding and resize factor.
The gadget size and position can also be reset.

Calculate_fitted_Font_BF() - Calculates the required font size for a specified arbitrary rectangle.
Calculate_fitted_Font_Width_BF() - For a limited text width.
Calculate_fitted_Font_Height_BF​​() - For a limited text height.

FittedText_BF()
This is a very powerful feature:
- It allows you to create a button-like text output.
- It works with Images, Sprites, Canvas, Window, Screen.
- with border, without border, transparent or with background color
- The functionality is as simple as the creation of a text button.
- The texts are adjusted automatically, however:
with padding x, y
with resize factor
text center, text right, text vertical, reverse text, RTL text

As usual with all extended BF functions, Start/StopDrawing is not necessary.
And all you have to do is specify the output ID: Canvas, Images, Sprites or Window will be detected automatically.
This feature makes it easy to create complex canvas-based gadgets or direct outputs.

The handling of text and graphics output on different output channels is drastically simplified by the above functions.

As a small bonus, the functions mentioned above are also supported separately by the "DrawText_BF Stand-alone Fork Module".
So the Wizzard module is not needed to use these essential functions.

The most important new demo codes:
- "Encryption" folder: Diverse Crypter - Including ImageGadget_BF usage - Dynamic text and image output - Resizable Window
- "ScaleGadgets_Using_with_GFX_Wizzard_BF" folder - Use of this popular module with BF features
- DynamicDialogs_Using_with_GFX_Wizzard_BF folder - Use of this popular module with BF capabilities
- "MAIN_Dynamic_Gadgets_base_Module_with_DrawText_BF_Stand-Alone_Fork_Module.pb"
- "MAIN_Dynamic_Gadgets_base_Module_with_DrawText_BF_Stand-Alone_Fork_Module_1.pb"
- "MAIN_Dynamic_Gadgets_and_Gadgets_BF_enhanced_Module.pb"
- "Text_output_Enhanced_fitted_text_on_windowed_screen.pb"
- "Universal_PB_function_output_Pi_Chart_with_Column_chart_with_DPI_aware_option.pb

The last demo listed here is a complete BF-enhanced code for creating column and pie charts.

There are currently about 200 different demo codes in the Wizzard archive.
From time to time these will be extended or adapted to new PB and BF features.
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
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 »

@Andre,
Thank you for presenting new versions of the 'Wizard' as they are written.
The best of both worlds!

Can you tell me if it supports the normal use of the Dialog Library?
DE AA EB
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

davido wrote:@Andre,
Thank you for presenting new versions of the 'Wizard' as they are written.
The best of both worlds!

Can you tell me if it supports the normal use of the Dialog Library?
Thank you, davido, you're welcome! :D

About the "normal" Dialog library:
As the DynamicDialogs package is a module, which is simplifying the creation of valid XML dialog code, you can of course use the PB Dialog library (and so the pure XML code) instead.
Just declare a Containergadget inside the dialog, and after creation of the dialog add regular PB gadgets inside the created container. This way the Wizzard gadget and GFX functions can be used on the regular PB gadget(s) and are working inside the dialog.
You find a simple demo code "DynamicDialogs_using_Gadgets_BF_ImageResizing.pb" inside the DynamicDialogs sub-drawer of the Wizzard archive. You need to set the right path to your separate DynamicDialogs includes and you can see how the PB gadget (here an image) will be created inside the container as "parent" included in the dialog definition. Using this example you should be able to see the way to go, replacing the DynamicDialogs code with the pure XML dialog definition... ;-)
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
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 »

@Andre,
Thank you for the quick reply. :D
DE AA EB
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2058
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: GFX_Wizzard_BF - [Modules - All OS]

Post by Andre »

Another bigger update of the GFX_Wizzard package (for small updates only the 'actual date' in first post will be updated).

Here is the announcement / change log:
walbus wrote: New functions integrated that highly simplify text handling:
- DrawText_Vector_BF ()
- FittedText_RoundBox_BF ()
- FittedText_RoundBox_Vector_BF ()
- RoundBox_Vector_BF ()

In addition, the following has been extended and optimized:
- Fork module equipped with the new features.
- MessageRequester_BF () extended.
The other MessageRequesters have been removed.
This new requester can automatically adapt texts, buttons and sizes. It supports ColorButtons, Images and GIF.
Screenshot of the new demo code:
Image
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Post Reply