GLG廣泛的 dials and meters、gauges、graphs、process control widgets 以及其它圖片控件的庫被放置在工具包對象引擎的頂端 – 是一個(gè)與傳統(tǒng)的編程控件創(chuàng)建完全不同的方法。
GLG's? extensive library of dials? and meters, gauges, graphs, process control? widgets and other graphical components is built on top of the Toolkit's? object engine - an approach radically different from the traditional methods of? creating programming components.
自定義外觀與感覺
該工具包提供了多個(gè)預(yù)置widget包:
-
實(shí)時(shí)圖表
-
2D圖片
-
3D圖片
-
控制組件
-
航空儀表
-
Avionics度量器
-
進(jìn)程控制圖標(biāo)
-
獨(dú)特的Widgets
每個(gè) widget 包都包含數(shù)十個(gè)到上百個(gè)的widget。每個(gè)widget都是用圖形構(gòu)建器創(chuàng)建的簡單繪圖。
控件的繪圖能加載到圖片創(chuàng)建程序中以瀏覽它的資源或進(jìn)行交互式的編輯。因?yàn)樵摽丶且粋€(gè)圖片對象的集合,所以它非常靈活。控制組件的外觀(色彩、外形以及對象的位置等)能通過使用創(chuàng)建程序的點(diǎn)選式界面進(jìn)行修改并且修改后的控件能保存以備以后使用。能運(yùn)行如編輯新標(biāo)簽、圖例以及axe的自定義操作。點(diǎn)這里查看更多關(guān)于圖片創(chuàng)建程序的信息。
因?yàn)橐曈X外觀被壓縮在繪圖里,所以每當(dāng)繪圖改變時(shí),應(yīng)用程序不需要進(jìn)行重新編譯。這可通過除去耗時(shí)的編譯連接周期以實(shí)現(xiàn)快速的原型化。
  所有的控件外觀能通過創(chuàng)建程序進(jìn)行完全自定義,這消除了控件源代碼的概念。這是因?yàn)槔L圖的功能就象是對對象外觀及行為的完整描述。
圖片創(chuàng)建程序能讓開發(fā)人員為控件屬性創(chuàng)建自定義名稱。這使您能非常輕易地訪問任何的控件屬性,這在基于代碼的控件中是不可能實(shí)現(xiàn)的,除非在代碼中處理的屬性本身能夠訪問。這些被命名的屬性變成了資源并能在運(yùn)行時(shí)從程序中訪問以改變控件的外觀或提供動態(tài)的實(shí)時(shí)數(shù)據(jù)。
該圖片創(chuàng)建程序同樣能用于創(chuàng)建控制面板或包含多個(gè)控件的面板或儀表盤。簡單地創(chuàng)建新畫板、實(shí)現(xiàn)拖放功能、使用鼠標(biāo)進(jìn)行定位與調(diào)整尺寸大小、為每個(gè)控制組件命名以訪問它的資源并保存繪圖。該控制面板已準(zhǔn)備好在應(yīng)用程序中使用。它同樣能通過創(chuàng)建程序中的模擬程序進(jìn)行原型化操作。
創(chuàng)建新的自定義控件
可根據(jù)暫存通過使用圖片創(chuàng)建程序的專業(yè)版或企業(yè)版創(chuàng)建新的自定義控件。同樣可使用現(xiàn)有的控件作為模板然后進(jìn)行修改。例如,通過復(fù)制一個(gè)刻度盤的指針然后將該指針粘貼到該刻度盤上以在該刻度盤上添加第二個(gè)指針。在第二個(gè)指針被重新命名后,它就能被程序的數(shù)據(jù)所驅(qū)動。因?yàn)樵撝羔槍ο蠹狭怂兴目刂茀?shù),所以不需要再做其它的工作。該指針的動態(tài)參數(shù)將被復(fù)制。在右邊顯示的模擬面板使用avionics gauges widget包以及是自定義控件的一個(gè)
很好的例子。
新創(chuàng)建的自定義控件能整合到圖片創(chuàng)建程序中,它們將出現(xiàn)在創(chuàng)建程序的控件調(diào)色板中。
自定義控件不僅僅只限于圖片、計(jì)量器或刻度盤。一個(gè)自定義控件能象一個(gè)用于將化學(xué)過程狀態(tài)視覺化的動態(tài)進(jìn)程控制繪圖工具一樣復(fù)雜。控制繪圖動態(tài)的參數(shù)能象資源一樣導(dǎo)出并能用于通過實(shí)時(shí)數(shù)據(jù)更新繪圖功能。
圖片創(chuàng)建程序的專業(yè)版能提供根據(jù)暫存創(chuàng)建自定義繪圖所需的功能。創(chuàng)建程序的企業(yè)版可用于為處理詳細(xì)的用戶交互添加自定義事件或顯示對象的提示信息。
編程API
GLG簡單實(shí)用的編程API是基于資源的。與其不停地為控件的資源學(xué)習(xí)不同的程序,還不如使用一個(gè)簡單的SetResource程序來設(shè)置任何資源,甚至是用戶自己創(chuàng)建的自定義屬性。程序員唯一需要知道的就是給出資源的名稱,不需要知道直觀的如FillColor的默認(rèn)設(shè)置或開發(fā)人員自己命名的資源的名稱。
該工具包能通過使用多種編程環(huán)境進(jìn)行部署,如硬件與軟件平臺。GLG控件可使用交叉平臺或本地特定平臺編程存儲器進(jìn)行部署。能以獨(dú)立平臺方式在Unix/Linux與Windows上使用交叉平臺C/C++ API,這能使應(yīng)用程序在不更改任何源代碼的情況下在所有平臺上進(jìn)行編譯和運(yùn)行。
  Windows的MFC類與Unix/Linux的Motif, Gtk or Qt widget可為不同的編程環(huán)境提供本地部署存儲器。同樣提供了Java開發(fā)的Java bean與Java類以及C#以及VB.NET部署的ActiveX 控制組件。HTML5 JavaScript 庫提供了一種 Web 部署選項(xiàng),其中包含可集成到 React、Angular 和 Next.js 框架中的 React、Angular 和 Next.js 組件。,了解有關(guān)可用編程容器和部署選項(xiàng)的更多信息。
編程 API 可用于在運(yùn)行時(shí)修改組件的資源,并使用實(shí)時(shí)數(shù)據(jù)使組件產(chǎn)生動態(tài)效果。它還可用于處理用戶交互。,了解有關(guān)使用該 API 提供數(shù)據(jù)的更多信息。
擴(kuò)展 API 允許應(yīng)用程序通過編程方式在圖形中創(chuàng)建對象并添加對象。如果在運(yùn)行時(shí)才知道圖形的性質(zhì)或?qū)ο?的數(shù)量,那么這種方式會非常方便。擴(kuò)展 API 還可用于實(shí)現(xiàn)圖形編輯器的功能(例如用鼠標(biāo)拖動對象)。,了解更多信息。
Customizing Look and Feel
The toolkit provides several pre-built widget sets:
- 2D Graphs
- 3D Graphs
- Controls
- Avionics Gauges
- Process Control Symbols
- Special Widgets
Each widget set contains from ten to a hundred widgets. Each widget is simply a drawing created with the Graphics Builder.
The component's drawing can be loaded into the Graphics Builder for browsing its resources or interactive editing. Since the component is a collection of graphical objects, it is extremely flexible. The control's appearance (colors, shapes and position of objects, etc.) can be changed interactively using the Builder's point and click interface, and a modified component can be saved for later use. More extensive customization, such as adding new labels, legends, and axes can also be performed.
Since the visual appearance is encapsulated in the drawing, the application does not have to be recompiled every time the drawing changes. This enables fast prototyping by eliminating time-consuming compile-link cycles.
All aspects of the component may be completely customized with the Builder, which eliminates the notion of a component's source code, since the drawing serves as a complete description of the object's appearance and behavior.
The Graphics Builder allows the developer to give custom names to a component's attributes. This provides an easy access to any component's attribute, which is not possible for code-based components, whereas only attributes that were handled in the code are accessible. Such named attributes become resources and can be accessed from the program at run-time to alter a component's appearance or to supply dynamic real-time data.
The Graphics Builder can also be used to create panels or dashboards containing multiple controls. Simply create a new canvas, drag-and-drop, position and resize controls using the mouse, name each control to access its resources and save the drawing. The control panel is now ready to be used in an application. It can also be prototyped with simulated data in the Builder.
Creating New Custom Components
New custom components can be created from scratch using the Professional or Enterprise Editions of the Graphics Builder. It is also possible to use an existing component as a template and modify it. For example, a second needle may be added to a dial by copying the dial's needle and pasting the copy into the dial. After the second instance of the needle is renamed, it is ready to
be driven by program's data. Since the needle object encapsulates all its controlling parameters, no extra work is necessary. The needle's dynamics parameters will have been copied. The simulation panel shown on the right uses avionics gauges widget set and is a good example of a custom component.
Newly created custom components can be integrated into the Graphics Builder, in which case they will appear in the Builder's component palette.
Custom components are not limited to graphs, meters or dials. A custom component may be as complex as a dynamic process control drawing used to visualize the state of a chemical process. The parameters controlling a drawing's dynamics are exported as resources and may be used by the program to update the drawing with real-time data.
The Professional Edition of the Graphics Builder provides the functionality required to build such custom drawings from scratch. The Enterprise Edition of the Builder may be used to add custom events for handling elaborate user interaction, or to display object tooltips.
Programming API
GLG's easy-to-use Programming API is resource based. Instead of learning a separate method for each of the component's resources, a single SetResource method is used to set any of its resources, even custom attributes created by the user. All a programmer needs to know is the name of a given resource, either an intuitive default such as FillColor, or a custom name given to the resource by the developer.
The Toolkit can be deployed using a variety of programming environments, as well as the hardware and software platforms. GLG components may be deployed using either a cross-platform or a native platform-specific programming container. A cross-platform C/C++ API may be used in a platform-independent way on both Unix/Linux and Windows, enabling an application to be compiled and run on any platform without any changes to its source code.
An MFC class for Windows and a Motif, Gtk or Qt widget for Unix/Linux provide native deployment containers for the respective programming environments. A Java bean and Java class library for the Java development, and an ActiveX Control for the C# and VB.NET deployment are also provided.
The Programming API may be used to modify resources of components at run-time and animate the component with real-time data. It may also be used to handle user interaction.