FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log inLog in 


Writing Colorful Reports via Scilex Controls

Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog Tips & Samples
View previous topic :: View next topic  
Author Message
Ferenc Nagy



Hungary
Joined: 24 Apr 2007
Posts: 378

PostPosted: 1 Nov 2014 18:35    Post subject: Writing Colorful Reports via Scilex Controls Reply with quote

Writing Colorful Reports via Scilex Controls
Introduction

The project deposited at http://franknagy.atw.hu/Tipp/Colorful website describes the creation and usage of colored, styled and formatted texts in Scilex controls invoked from Visual Prolog 7.5 programs. This is embedded in an example program which contains other tricks like
User-friendly font handling
Error capturing and reporting
Extended common dialogs
Interface to help files
Providing tooltips
Organization of styles into databases

Origin of the Problem
The earlier versions of Visual Prolog contained a message window where the programmer could redirect the standard output and show the results of the program. The message control embedded in the message window, however, could display all of its received text in the same font face and size. The necessity to separate the occasional trace lines from the important, carefully formatted tables of the important results the programmers faced had to wait for the embedding of the more sophisticated control.

Generation of Colored and Styled Reports
The VIP Support Team answered to the author's question that typographic tricks would be available in later versions of the Visual Prolog when the internal editor and the message control would be replaced by the Scintilla editor.
Solution by SciLexer
The developer team of the Visual Prolog language has built in the Scintilla editor in the version 7.4. The sciLexer package provides comprehensive bindings to the Scintilla editor with language lexers, including a lexer for Visual Prolog code. See tutorial article. Thomas Linder Puls and Dominique F. Pannier have given the author the impetus in this thread of the visual Prolog Discussion Forum.
Supported Features of the Scilexer Controls
The author's goal was not the edition of the text written in the Scilexer controls. He wanted only to distinguish the trace lines from error and warning messages, tabulated and single line results. The predicates defining the styles and applying the to the recently written texts were enough from the scilexerBase, scilexer_native and scilexer_api modules. Unlike the example Dominique F. Pannier, his goal was not parsing the text of a whole file in order to perform syntax coloring but immediate styling of small fragments of the text. By the way if the styles are undefined when the text lines are appended to the contents of the scilex control then the later definition of the styles will be distinguish them as you can see from pressing the [Apply] button of the style set handling form of the test program.

Features of the styles
The styles are identified not only by an integer identifier.
They have foreground and background colors.
They have fonts with the usual attributes:
name,
size,
style flags: bold, italic, underlined.

The program extracts the font class from the Microsoft Font Structure describing the font. The font class may be monospace or proportional. It is an extremely important information because only monospace font are suitable to make tables without tabulators.

See also: http://wiki.visual-prolog.com/index.php?title=3rd:Colorful_Reports_within_Scilex_Controls



F1.png
 Description:
Full screen
 Filesize:  150.11 KB
 Viewed:  2956 Time(s)

F1.png



_________________
TIA, Regards,
Frank Nagy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog Tips & Samples All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum