[Module] ViewerEx.pbi (all OS)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

[Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

ViewerEx - Module (all OS / DPI / 64Bit)

A gadget to display content, e.g. about info, licenses, hints, help, etc.
  • directly add content or load previously created content
  • texts with WordWrap or automatic hyphenation
    (left-, right-justified, centered, justification)
  • lists, URLs & internal links
  • headings with automatic numbering
  • images
Image

Code: Select all

;  ----- Commands -----

;  ViewerEx::ClearContent()       - clear gadget content
;  ViewerEx::EventValue()         - return string value for the event (e.g. URL)
;  ViewerEx::Gadget()             - new gadget
;  ViewerEx::Load()               - load contents for the gadget from a file
;  ViewerEx::SetAutoResizeFlags() - automatically adjust gadget to window size.
;  ViewerEx::SetContent()         - select or change content using its label
;  ViewerEx::SetHeadingOffset()   - offset for numbering headings

;  ----- #Enable_AddViewerContent & #Enable_CreateViewerContent -----

;  ViewerEx::UseFont()    - specify the character set to be used.
;  ViewerEx::UseImage()   - specify images to be used
;  ViewerEx::UsePattern() - set hyphenation patterns to be used

;  ----- #Enable_AddViewerContent (add content directly) -----
;  ViewerEx::AddHeading()      - insert numbered headline into gadget
;  ViewerEx::AddImage()        - insert image into gadget
;  ViewerEx::AddLink()         - insert internal link into gadget
;  ViewerEx::AddListing()      - insert a listing with bullets
;  ViewerEx::AddSpacing()      - insert space between the items
;  ViewerEx::AddText()         - insert text into gadget
;  ViewerEx::AddURL()          - insert URL into gadget
;  ViewerEx::DefineHeading()   - define the appearance of headings
;  ViewerEx::DefineStyle()     - define the appearance of texts
;  ViewerEx::DisableReDraw()   - temporarily disable content redrawing
;  ViewerEx::Save()            - save the current content of the gadget with all required resources
;  ViewerEx::SetHyphenation()  - activate hyphenation for the corresponding language (pattern).
;  ViewerEx::SetMargin()       - define page margins

;  ----- #Enable_CreateViewerContent -----

;  ViewerEx::Create()            - create a new page with content under this label.
;  ViewerEx::Close()             - close the page with the corresponding label.
;  ViewerEx::CopyContent()       - copy generated content into a ViewerEx - Gadget.
;  ViewerEx::Export()            - export generated pages with content and save them with all resources in one file.
;  ViewerEx::Heading()           - add a numbered heading.
;  ViewerEx::HeadingDefinition() - defining the appearance of headings.
;  ViewerEx::Hyphenation()       - activate hyphenation for the corresponding language (pattern).
;  ViewerEx::Image()             - add a image.
;  ViewerEx::Link()              - add a internal link.
;  ViewerEx::Listing()           - add a listing with bullets
;  ViewerEx::Margin()            - define page margins.
;  ViewerEx::Spacing()           - add space between items.
;  ViewerEx::StyleDefinition()   - define the appearance of texts.
;  ViewerEx::Text()              - add text.
;  ViewerEx::URL()               - add a URL.
Download: ViewerEx.pbi
Last edited by Thorsten1867 on Fri Dec 20, 2019 2:58 pm, edited 2 times in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: [Module] ViewerEx.pbi (all OS)

Post by RSBasic »

Image
Image
Image
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: [Module] ViewerEx.pbi (all OS)

Post by Andre »

Cool idea, thanks! :D

Small bug: If I resized the demo to full window height, the buttons "jump" from buttom of the window "into" the "viewer area".
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
StarBootics
Addict
Addict
Posts: 984
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: [Module] ViewerEx.pbi (all OS)

Post by StarBootics »

Don't forget about the Button height on GTK3 (Ubuntu) is 34 pixels no matter what the size you set the button height.

On windows resize the button are not re-localized at all, a minor bug to fix.

Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

Andre wrote:Cool idea, thanks! :D

Small bug: If I resized the demo to full window height, the buttons "jump" from buttom of the window "into" the "viewer area".
The buttons are only part of the example and not of the module.
With 'ResizeExModule.pbi' you can solve the problem.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

New: 'ContentCreator.exe'

This allows you to create content for ViewerEx.

Image
Last edited by Thorsten1867 on Mon Dec 23, 2019 6:13 pm, edited 4 times in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
skywalk
Addict
Addict
Posts: 3972
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: [Module] ViewerEx.pbi (all OS)

Post by skywalk »

Thorsten1867 - You are a machine :!: 8)
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

Update: Content Creator
  • Added: Support of multiple pages (incl. linking)
  • Added: Settings (Margins & Pattern for hyphenation)
  • Added: SourceCode (MacOS/Linux)
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

Update: Content Creator
  • resizable
  • ListViewGadget replaced by ListView-Module
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

Update: Content Creator
  • Added: Content Tree (e.g. for help)
  • Added: Preview for content tree
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

Update: HelpEx - simple HelpViewer based on ViewerEx.

Image
Last edited by Thorsten1867 on Mon Dec 23, 2019 4:32 pm, edited 1 time in total.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

Update:
  • Added: AddImageText() / ImageText() - text next to an image
  • Added: AddImageListing() / ImageListing() - image instead of bullet
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Mindphazer
Enthusiast
Enthusiast
Posts: 340
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: [Module] ViewerEx.pbi (all OS)

Post by Mindphazer »

Hi,
i have this error while compiling on MacOS
I think this procedure is called before its definition

Code: Select all

[18 :28 :21] [COMPILER] Ligne 467: OSX_NSColorToRGB() is not a function, array, list, map or macro.
MacBook Pro 14" M1 Pro - 16 Gb - MacOS 14 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2056
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Re: [Module] ViewerEx.pbi (all OS)

Post by Andre »

Again, a great module with useful extensions (HelpEx)! Thank you very much for sharing :D
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: [Module] ViewerEx.pbi (all OS)

Post by Thorsten1867 »

Bugfix for MacOS
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
Post Reply