boolsoft presents
Advanced Dialogs
- v1.01 -
Advanced Dialogs is cross-platform (AMS and PedroM)
static library for TIGCC for
creating grayscale dialogs. It combines the usefulness of AMS Dialogs
with the speed of TIGCC and ExtGraph, offering all standard functions
(Title, Buttons, Input, DropDown, MessgaeBox etc.) and additional
useful features not offered by AMS (Multiple Tabs in a dialog, Bitmaps,
CheckBoxes, ProgressBars etc.). Providing this features, Advanced
Dialogs allows the easy creating of a fast and beautiful GUI for your
TIGCC project.
Contents
I. II. III. IV. V. VI. VII. VIII. IX. a) b) X. a) b) c) d) XI. XII. XIII. XIV. |
Screenshots How to include Advanced Dialogs in your TIGCC project Compability Navigation How to setup a standard dialog How to check the results of a dialog Bimaps ProgressBar and MessageBox Important notes Interrupt handler Misc. notes Description of the functions Dialog functions Bitmap functions MessageBox functions ProgressBar functions Credits License Contact History |
![]() |
This screenshot is take from the
example "Simple Dialog". |
|
![]() |
This screenshot is take from the
example "Input". |
|
![]() |
This screenshot is take from the
example "ProgressBar". |
|
![]() |
This screenshot is take from
example "Multiple Tabs". |
|
![]() |
This screenshot is take from
example "Bitmap". |
II. How to
include Advanced Dialogs in your TIGCC project
If you want to use Advanced Dialogs in your TIGCC project, you will
need four files in order to get it working:
AdvDialogs.h AdvDialogs.a extgraph.h extgraph.a |
Advanced Dialogs header file Advanced Dialogs archive file (the library) ExtGraph header file ExtGraph archive file |
III. Compability
For checking if Advanced Dialogs is compatible to your project and/or
calculator, use the following table.
HW 1 HW 2 HW 3 PedroM |
AMS >= 1.01 AMS >= 1.01 AMS >= 1.01 version >= 0.81 |
IV. Navigation
The following table shows the keys and their meanings.
[ENTER] [ESC] [APPS] [LEFT]/[RIGHT] [UP]/[DOWN] |
Closes the dialog and returns TRUE Closes the dialog and returns FALSE Switches between the tabs from left to right (Un)check CheckBoxes; Select an item in a DropDown element Switches between interactive elements (CheckBox, InputBox and DropDown) |
V. How to setup
a standard dialog
Before you use the Advanced Dialogs library, you should understand the
structure of the dialogs you can create with it. Look at the following
picture to get an idea of it.
As you can see, a dialog can contain multiple tabs, while the maximal
number is 6. Each tab can contain multiple elements (e.g Text or
CheckBoxes), while ýou can store up to 6 elements per tab. This
makes a total of 36 (!) elements per dialog.
If you understand this structure, it is easy to set up complex dialogs.
All you have to do is keep track of the correct order:
1. 2. 3. |
Create a new dialog using AdvDlgNew(...) Add a tab to the dialog using AdvDlgAddTab(...) Add some elements to the tab |
ADVDIALOG GrayOff() AdvDlgAddTab(dialog, 0, "Tab No.1") AdvDlgAddText(dialog, 0, 1, "This is the first tab", TXT_STANDARD, COLOR_BLACK) AdvDlgAddTab(dialog, 1, "Tab No.2") AdvDlgAddText(dialog, 1, 2, "Centered text...", TXT_CENTERED, COLOR_WHITE) AdvDlgAddButton(dialog, 0, B_OK) AdvDlgAddButton(dialog, 1, B_ESC) AdvDlgDo(dialog, DUMMY_HANDLER) AdvDlgFree(dialog) GrayOff() |
VI. How to check
the results of a dialog
If your dialog uses interactive elements (InputBoxes, CheckBoxes or
DropDowns), you might want to know the values the user selected or
entered.
In InputBoxes, the pointer to the inputbuffer contains the string the
user entered.
When using DropDowns, the pointer to the selected argument will contain
the selected argument after execution of the dialog.
CheckBoxes are different: you can check their results via a global
array named AD_CHECKED. So,´you could check the content
of CheckBox '2' in Tab '0' with:
VII. Bitmaps
Starting from version 1.0, you are able to add images to dialogs
(tabs), which are called bitmaps. They have their own type named ADVBITMAP.
The format of bitmaps is based on the TIOS BITMAP format: A
variable of type ADVBITMAP contains the x- and the y-postion of
the bitmap as well as two variables of type BITMAP - one for
the light and one for the dark plane. The bitmaps are drawn using the
TIOS- and PedroM-built-in routine BitmapPut.
The x- and y-position of a bitmap are relative to the dialog to which
it has been added (that's why they are specified when you add the
bitmap, not when you create it). The bitmap is clipped inside the
dialog to which it has been added.
In this version, it is only possible to add 1 bitmap to a dialog (tab),
although future version might enable more bitmaps per dialog (tab).
VIII.
ProgressBar and MessageBox
Beside the standard dialog functions, Advanced Dialogs also offers two
other functions that are totally independent from the dialogs. These
functions are AdvDlgProgressBar, which will draw a ProgressBar
to add some animation to a process, and AdvDlgMessageBox, that
can be used to display one-line messages with a single call.
I will explain these functions briefly, but please take a look at the
examples to see some code that will make them work. See also the description of the functions for neccessary arguments for
the functions.
a) ProgressBar
Look at the following table to see which routines you have to call to
set up a ProgressBar:
1. 2. |
Set up the ProgressBar with AdvDlgProgressBar(...) Call AdvDlgProgressUp() until the ProgressBar is filled |
IX. Important
notes
a) Interrupt handlers
In most grayscale programs, AUTO_INT_1 and AUTO_INT_5 are disabled to
avoid the display of the 2ND, ALPHA, or diamond-indicators in the
status line. Programs that are using low-level keyboard reading should
disable these interrupts as well.
However, Advanced Dialogs doesn't disable interrupts to make functions
like InputBox possible and to keep compability to PerdroM, which
doesn't support _rowread.
Therefore, the functions AdvDlgDo(...) and AdvDlgMessageBox(...)
take an interrupt handler as an argument. If your program disables
interrupts, you should use the saved AUTO_INT_1 for this argument. If
you do so, Advanced Dialogs will use GraySetInt1Handler(...) to
reinstall a temporary AUTO_INT_1 and install DUMMY_HANDLER before it
exits.
If you do not disable interrupts in your program, you should pass
DUMMY_HANDLER as an argument.
b) Misc. notes
Another thing that is important when working with Advanced Dialogs is
to keep track of the functions you call, because this library won't
do error checking of the arguments or of the functions.
To make sure your program runs as well as it should, you must not
exceed the limits of a dialog (add more than 6 tabs per dialog or more
than 6 elements per tab).
If you don't want to use tabs in your dialog or if you just have one
tab, all you have to do is not to call AdvDlgAddTab(...) and
add all elements to tab '0'.
Advanced Dialogs is released under the GNU General Public License, so
you will find the complete source in the folder "\source". If you have
some experience with C, it should be easy to modify the dialog routines
to fit your needs. You are completely free to add your own extensions,
or to program a different style etc. Please feel free to send me your
modifications - perhaps I will include them in this package.
X. Description
of the functions
a) Dialog functions
ADVDIALOG |
width height title savescreen |
short const char BOOL |
Width of the dialog Height of the dialog Title of the dialog If you set this to TRUE, the screen will be saved and restored before and after the calling of AdvDlgDo(...). |
|
dialog tab title |
ADVDIALOG const char |
Pointer to the dialog created with AdvDlgNew(...) Number of the new tab Title of the new tab |
|
dialog tab line text attr color |
ADVDIALOG short const char short |
Pointer to the dialog created with AdvDlgNew(...) Number of the tab where the Text will appear Number of the line of the tab where the Text will appear Text to be displayed Attribute of the Text. This can either be TXT_STANDARD, TXT_ALIGNRIGHT or TXT_CENTERED Color of the text. This can either be COLOR_BLACK or COLOR_WHITE |
|
dialog tab line text buffer maxsize mode color |
ADVDIALOG short const char short short |
Pointer to the dialog created with AdvDlgNew(...) Number of the tab where the InputBox will appear Number of the line of the tab where the InputBox will appear Text to be displayed (can be used for a question etc.) Buffer to store the input Maximal number of chars than can be entered If you pass INPUT_STR, letters and numbers can be entered If you pass INPUT_INT, only numbers can be entered Color of the text. This can either be COLOR_BLACK or COLOR_WHITE |
|
dialog tab line text checked color |
ADVDIALOG short const char BOOL |
Pointer to the dialog created with AdvDlgNew(...) Number of the tab where the CheckBox will appear Number of the line of the tab where the CheckBox will appear Text to be displayed (can be used for a question etc.) Indicates if the CheckBox will be marked Color of the text. This can either be COLOR_BLACK or COLOR_WHITE |
|
dialog tab line text itemlist numitems selected color |
ADVDIALOG short const char short |
Pointer to the dialog created with AdvDlgNew(...) Number of the tab where the DropDown menu will appear Number of the line of the tab where the DropDown menu will appear Text to be displayed (can be used for a question etc.) Items for the DropDown menu Number of items for the DropDown menu Indicates which item will be selected by default Color of the text. This can either be COLOR_BLACK or COLOR_WHITE |
|
dialog tab x y bitmap |
ADVDIALOG short short ADVBITMAP |
Pointer to the dialog created with AdvDlgNew(...) Number of the tab where the DropDown menu will appear X-Position of the bitmap (relative to the dialog) Y-Position of the bitmap (relative to the dialog) Pointer to the bitmap created with AdvDlgBitmapNew(...) |
|
dialog pos button |
ADVDIALOG short |
Pointer to the dialog created with AdvDlgNew(...) Position of the Button (0 = left, 1 = right) Type of the Button. Valid types are B_OK, B_ESC, B_YES, B_NO and B_NONE (However, it is not necessary to use B_NONE. Simply do not call this function if you don't want to add a button). |
BOOL AdvDlgDo(ADVDIALOG |
dialog tempint1 |
ADVDIALOG INT_HANDLER |
Pointer to the dialog created with AdvDlgNew(...) AUTO_INT_1 (see Important notes for more info) |
|
dialog | ADVDIALOG |
Pointer to the dialog created with AdvDlgNew(...) |
ADVBITMAP |
width height lpdata dpdata |
short unsigned char |
Width of the bitmap Height of the bitmap Image data for the light plane Image data for the dark plane |
|
title msg textcolor button tempint1 |
short INT_HANDLER |
Title of the MessageBox Text to be displayed Color of the text. This can either be COLOR_BLACK or COLOR_WHITE Button at the lower right corner. See AdvDlgAddButton(...) for a description of valid buttons. AUTO_INT_1 (see Important notes for more info) |
|
title msg steps |
|
Title of the ProgressBar dialog Text to be displayed Number of steps of the ProgressBar |
|
XI. Credits
Advanced Dialogs
v1.01 - 22.02.2006
written by
Jonas Gehring (aka saubue),
member of boolsoft
compiled with TIGCC v0.96 Beta 6
powered by ExtGraph v2.00 (pre)beta 5
tested and debugged with TiEmu and VirtualTI
Beta-Testers:
Epsilon
MathStuf
Thanks to:
The TIGCC Team for
their wonderful compiler and IDE
The TI-Chess Team for
the great ExtGraph library
The Linux Programming Group
for TiEmu
mhubi
Epsilon and MathStuf for their suggestions (Epsilon had the
great idea to use tabs)
All people who support the community and who are trying to
keep everything together
XII. License
Advanved Dialogs v1.01
Copyright (C) 2005 - 2006 Jonas Gehring
Advanved Dialogs is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Advanved Dialogs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Advanved Dialogs; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA.
XIII. Contact
If you have any comments or suggestions, if you want to support
boolsoft, if you have found a bug or if you just want to say "hello!",
please write to:
saubue@mobifiles.de
or
jonas.gehring@mobifiles.de
For future updates and other programs, please visit our homepage and
sign out guestbook:
http://boolsoft.mobifiles.de
or
http://boolsoft.mobifiles.com
For further discussion of Advanced Dialogs and our
other projects and programs as well as for minor updates, visit our
message board:
http://boolsoft.mobifiles.de/board
If you want to meet the biggest german TI community,
please visit MobiFiles:
http://www.mobifiles.de
and its message board at
http://forum.mobifiles.de
Date |
Version # |
Features / Changes |
22.02.2006 |
1.01 |
Fixed silly logical bug -
right-aligned text has the attribute TXT_ALIGNRIGHT
and NOT TXT_ALIGNLEFT, of course... |
17.01.2006 |
1.0 |
Added Bitmap-functions Modified x- and y-Position of Elements in dialogs with no tabs Added TXT_ALIGNLEFT as a text attribute. Renamed examples and added another one to demonstrate the new Bitmap-functions |
19.12.2005 |
1.0beta |
Massive Changes in this near-final version: - The construction of the dialogs has changed once again to make multiple tabs possible. They are called like TI-BASIC-Dialogs now. - You are able to use tabs now, so up to 36 lines of text, input etc. can be stored into 1 dialog. You can switch tabs by pressing [APPS] - Inputs can now scroll, so the string is not limited to the size of the InputBox - Added DropDown menu - Dialogs now have their own type (ADVDIALOG). They are initialized as pointers, AdvDlgNew(...) allocates the space for them. - Added example #4 to demonstrate the new tab features - The whole documentation has been rewritten |
07.09.2005 |
0.91 |
Fixed bug in AdvDlgProgressUp() when using a 240x128
screen '\' is now also allowed in InputBoxes with INPUT_STR |
29.08.2005 |
0.9 |
Finally a nearly complete version (that's the reason for 0.9)
and a lot of new things: - Dialogs have to be called totally different. This makes working with them easier and more dynamically. - Added CheckBox-feature - Improved ProgressBar-feature - You can scroll through the interactive elements with [UP] and [DOWN] - added optimizations by MathStuf that made screen centering wasting less bytes. |
26.08.2005 | 0.5 | The standard dialog is variable-sized and centered on the screen. |
22.08.2005 |
0.46 |
Bugfixes and optimizations. Thanks to MathStuf!! |
09.08.2005 | 0.45 | All dialogs and the ProgressBar are now centered on a TI92+/V200, too |
08.08.2005 | 0.4 | Added MessageBox-function |
06.08.2005 |
0.3 |
Added ProgressBar-functions Added example #3 |
12.06.2005 |
0.22 |
Fixed bug in example #2 Documentation updated |
20.03.2005 | 0.21 | First release |