Click here to Skip to main content
13,551,695 members
Click here to Skip to main content
Add your own
alternative version

Stats

43.2K views
2.8K downloads
39 bookmarked
Posted 17 Apr 2015
Licenced LGPL3

GT: A C++ Graphical User Interface Library and System

, 13 Feb 2017
Rate this:
Please Sign up or sign in to vote.
GT is a compact, efficient, and customizable graphical user interface (GUI) library for the Windows environment.

GT

A C++ Graphical User Interface Library and System
Author: Anthony Daniels
email: AnthonyDaniels99@gmail.com

Download source

Download GTTestApps_20170213.zip

Introduction

GT is a compact, efficient, and customizable graphical user interface (GUI) library for the Windows environment (eventually Linux and Mac will be added). The majority of the code is platform independent, only relying directly on the Operating System’s graphics, threading, and clipboard APIs (these features are encapsulated). With the number of GUI systems growing, one might ask why make another system. GT was made to address shortcomings in some of the major competitors in addition to being really compact (GT currently has approx. 90,000 lines of code, or LOC, including comments). With the LOC count this low, GT is possible to embed directly into your application solution or project files. Its major competitors are MFC, QT, GIMP Toolkit, wxWidgets, Fox Toolkit. GT most closely tracks with QT in design and function, but here are some of the differences.

Comparison to Competitors

First and foremost, the entire GT framework is built on top of the HPC Template Library (HTL). The HTL is a supplement to the Standard Template Library (STL) that provides thread safe objects geared towards multi-thread and multi-process programming. While GT makes use of almost the whole HTL, three of the HTL packages are relied on most heavily. These are the containers, signals and slots, and threading packages. GT uses only thread safe containers for all critical functions in the objects of the library. GT is also a signal and slot based system like QT. Unlike the macro based event coupling to code used in MFC and Fox Toolkit (which is not debug traceable), signals and slots provide a much cleaner means of connecting events to code. GT has a few improvements over the QT version of signals and slots. First, you can have public, protected, and private signals, whereas QT only allows protected. Second, connection is not done with a macro like in QT. Third, there is no need for the Q_OBJECT meta-object and code, providing for a cleaner package (no meta-object compiler step). Fourth, any function in a GtObject can be attached to a signal of same prototype (QT’s most recent version does this as well, but the author wanted to mention it anyways); there is no declaration of “slots:” required. Every member function is a potential slot.

Another major difference is that GT does not draw native controls. If you really drill down into the code of some of the other packages (QT for example), you will find that they are drawing API native controls in most cases. This many levels of indirection to a single monolithic painter that draws all the different controls is different than the approach taken by GT. Every GtWidget has an OnPaint() method and the widget is responsible for drawing itself. The graphics are simpler than most current generation operating systems controls, but that choice was in line with the compactness feature of GT. Users are fully encouraged to change the paint algorithms if they want a more sophisticated look.

GT, like QT, has an abstract item model system available for displaying in the GUI collections of objects and their data. QT has the design philosophy that lists, tables, and trees all use the same abstract item model. However GT employs individual abstract item models for lists, tables, and trees. The choice to have a listmodel, tablemodel, and treemodel was made because the author believes that the code is simpler and easier to use and build on top of. This fundamental shift in abstract item model design was the reason GT was created. The author is a long time user and fan of QT.

Gt Library Structure

GT currently has four libraries, GtCore, GtGui, GtOpenGL, and GtChart. GtCore contains all of the core classes for the GT system. It has the following packages; GtBase, GtEvent, GtGeometry, GtGraphic, GtInputOutput, GtItemModel, GtMath, GtProcess, GtSorting, GtStateMachine. Descriptions of these packages and their constituent classes will be in the class overview document. GtGui contains all of the classes for basic GUI development. It has the following packages; GtBasicControls, GtGridView, GtModelView, GtScientific, GtTextView, GtWinForms. GtOpenGL contains the necessary classes to allow for 3D object visualization via the OpenGL library. GtChart contains the classes required for scientific plotting and charting.

Sample GUIs

The sample pack has 15 different GUI projects that illustrate the use of every type of control in GT. In order to build the sample pack, have the GT2013 and GT_TEST_2013 folders at the same level in the file hierarchy. Copy the libraries from the GT2013 Debug or Release folder into the target folder for the sample pack. You should now be able to build and run the sample pack. The sample applications are as follows:

NameDescription
GtTest_02_SimpleThis application illustrates most of the basic controls of GT.
GtTest_03_ToolBoxThis application illustrates the use of the toolbox Control.
GtTest_04_TabViewThis application illustrates the use of the tab view control.
GtTest_05_ScrollAreaThis application illustrates the use of the scrollable area control.
GtTest_06_ModalThis application illustrates the use of modal and modeless dialogs.
GtTest_07_ListViewThis application illustrates the use of the abstract item list view.
GtTest_08_TableViewThis application illustrates the use of the abstract item table view.
GtTest_09_TreeViewThis application illustrates the use of the abstract item tree view.
GtTest_10_OpenGLThis application illustrates the use of the 3D viewer.
GtTest_11_SimpleChartThis application illustrates the use of the basic plot2D.
GtTest_12_LogChartThis application illustrates the use of the logarithm scales.
GtTest_13_BarColumnThis application illustrates the use of the bar and column charts.
GtTest_14_PieChartThis application illustrates the use of the pie chart.
GtTest_15_MultiPlotThis application illustrates the use of the generic multiplot.

Sample GUIs Screenshots

Here are some of the sample GUI screenshots.

GtTest_02_Simple Application
 
GtScientific Controls Sample

GtTest_03_ToolBox Application

GtTest_07_ListView Application

GtTest_10_OpenGL Application

GtTest_12_LogChart Application

GtTest_14_PieChart Application

GtTest_15_MultiPlot Application

Known Issues

Currently, there is a known freeze bug in Release mode only for the GtTest_06_Modal application. Upon closing, the modal dialog causes the parent dialog to freeze. This bug does not persist in the Debug version.

Any bugs, report to the author and if you are interested in helping with GT development, let me know. I intend on setting up a GitHub repository for the project.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)

Share

About the Author

trident99
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
QuestionMessage Removed Pin
14-Aug-17 21:45
memberMember 250475814-Aug-17 21:45 
QuestionAre "Skins" , or bitmap backgrounds possible Pin
frqftgbdafr22-Feb-17 11:03
memberfrqftgbdafr22-Feb-17 11:03 
AnswerRe: Are "Skins" , or bitmap backgrounds possible Pin
trident9923-Feb-17 14:44
membertrident9923-Feb-17 14:44 
QuestionLook and feel is 1980 Pin
D. Infuehr22-Feb-17 4:39
memberD. Infuehr22-Feb-17 4:39 
QuestionHow does this compare with CopperSpice? Pin
Zebedee Mason27-Jan-17 2:18
memberZebedee Mason27-Jan-17 2:18 
AnswerRe: How does this compare with CopperSpice? Pin
trident994-Feb-17 14:28
membertrident994-Feb-17 14:28 
QuestionLGPL and Embedding is an oxymoron Pin
jacmoe24-Apr-15 6:38
memberjacmoe24-Apr-15 6:38 
AnswerRe: LGPL and Embedding is an oxymoron Pin
trident9924-Apr-15 7:22
membertrident9924-Apr-15 7:22 
GeneralRe: LGPL and Embedding is an oxymoron Pin
jacmoe24-Apr-15 7:34
memberjacmoe24-Apr-15 7:34 
GeneralRe: LGPL and Embedding is an oxymoron Pin
0xC000005425-Apr-15 2:40
member0xC000005425-Apr-15 2:40 
GeneralRe: LGPL and Embedding is an oxymoron Pin
jacmoe25-Apr-15 3:35
memberjacmoe25-Apr-15 3:35 
GeneralRe: LGPL and Embedding is an oxymoron Pin
0xC000005425-Apr-15 4:51
member0xC000005425-Apr-15 4:51 
GeneralRe: LGPL and Embedding is an oxymoron Pin
jacmoe25-Apr-15 5:05
memberjacmoe25-Apr-15 5:05 
QuestionBest Racing Sim Game Ever... Pin
thund3rstruck23-Apr-15 10:37
memberthund3rstruck23-Apr-15 10:37 
SuggestionGood vehicle for Google Material Design Pin
Gnawme23-Apr-15 8:33
memberGnawme23-Apr-15 8:33 
GeneralUI looks primitive Pin
Sharjith20-Apr-15 2:06
professionalSharjith20-Apr-15 2:06 
GeneralRe: UI looks primitive Pin
Kochise20-Apr-15 6:20
memberKochise20-Apr-15 6:20 
GeneralRe: UI looks primitive Pin
trident9920-Apr-15 6:44
membertrident9920-Apr-15 6:44 
GeneralRe: UI looks primitive Pin
Shao Voon Wong20-Apr-15 17:46
professionalShao Voon Wong20-Apr-15 17:46 
GeneralRe: UI looks primitive Pin
Sharjith20-Apr-15 19:45
professionalSharjith20-Apr-15 19:45 
GeneralRe: UI looks primitive Pin
Kochise20-Apr-15 20:37
memberKochise20-Apr-15 20:37 
GeneralRe: UI looks primitive Pin
trident9923-Nov-16 6:42
membertrident9923-Nov-16 6:42 
Questionhave you consider to post this as a tip? Pin
Nelek17-Apr-15 12:27
protectorNelek17-Apr-15 12:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180515.1 | Last Updated 13 Feb 2017
Article Copyright 2015 by trident99
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid