en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en nl en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en es de en en en en en nl en en en en en en en en en en en en en en es en en en en en en en nl en en en en en en en en en en en en en en it en en en en en en en en en en en en en en en en en en en en es en en en en en en en nl en en en en en en en en en en ru en de en en en en en en en en en en en en en en en es en en en en en en en nl en en en en en en en en en en en en en en en en en en en es en en en en en en en nl en en en en en en en en en es en en en en en en en nl vi en en en en en en es en en en en en en en nl en en en en en en en en en en en en es en en en en en en en nl fr en en en en en en en en en en en en en fi nb en en en en en en en fr en ja en en en en en en en fr en pt en en mwl it en en en en en mwl en en en en en en en en en en en en en es en en en en en en en nl en en en en en en en en es en en en en de en en en fr en en en en en en en en en pt en en en en en en
Do you need to write Graphic oriented apps ? save $70 on EZGUI 4.0 Pro - PowerBASIC Peer Support Community
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in Third-Party Forums only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Do you need to write Graphic oriented apps ? save $70 on EZGUI 4.0 Pro
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
EZGUI 4.0 Professional is now on sale
from July 11, 2008 to July 27, 2008.
The price is only $179 (US)
which is a savings of $70.
For those interested in learning about the advantages of using EZGUI 4.0 pro, here are some long posts on my forum about what makes EZGUI 4.0 Pro different and how it benefits you.
There are features in EZGUI 4.0 Pro not found in any other GUI tool, so find out what they are.
EZGUI 4.0 Professional makes development of
EZGUI provides graphics for all sorts of tasks. It is an integrated Graphics engine.
You could purchase a Visual Designer separately, a Graphics Tool separately, a Print engine separately, but with EZGUI it all comes in one integrated package. When you use separate tools for each task, you have to learn the syntax of each tool and if they come from different vendors they likely will all be quite different in style.
EZGUI has a single core Graphics engine, which is then accessible to the print engine, Canvas control, DC drawing and Ownerdraw. You learn one syntax and use it over and over again for different drawing devices.
EZGUI also provides a unique Sprite engine (moveable, non-rectangular images) for use with its Graphic control. Sprites can also be used to draw permanently on the Canvas control, which can then be used to build images for drawing on the printer.
The Sprite engine provides a very powerful AlphaBlending and Anti_Aliasing engine.
EZGUI provides both high level and low level graphics features.
I don't know if any other graphic tools have this feature or not, but EZGUI's Canvas control provides the ability to define its image buffers as DIB sections (16 bit, 24 bit or 32 bit) so you can access the pixel data directly.
EZGUI's Canvas control is a real window control, designed specifically for Graphics. It supports things like Double Buffers and DIB's.
Its true there are other tools which support Graphics.
With EZGUI though, you can sum it up this way:
EZGUI's Canvas control, Turtle Graphics control, Ownerdraw, DC Drawing, Form background drawing, control background drawing (via subclassing) and Print engine are all integrated.
Since drawing to a DC is the lowest level of drawing, the Graphic engine command set starts with the DC drawing commands. Then the higher level, Canvas drawing and Printer drawing command sets are built on top of these. OwnerDraw is drawn using the DC versions of the command set. Control or Form background drawing is also done at the DC level.
Once you learn the basic syntax of the graphic command set, you can apply that to the Canvas control, Printer and even Ownerdraw controls.
EZGUI even provides building complex regions from a Bitmap (for Forms) or the current image buffer of either the Canvas or Turtle graphic controls. Again this feature is integrated, so it is easy to apply it to a form, Canvas or turtle control.
The Visual Designer even supports Form regions (based on a Bitmap) Visually. Test your Forms (with regions) visually and see how they will actually look.
Another integrated feature is the simplified ownerdraw command set. Not only is low level owner draw supported (you can write your own ownerdraw routines using the graphics engine), but there is a high level owner draw command based on this integrated graphic engine.
Some of the ownerdraw is even supported visually in the designer. You can use 2D and 3D colored buttons in the Designer. You can even create your own button ownerdraw plugins so you can use your own ownerdraw code (your app will use the EZGUI command set source code in an include, but the designer uses a compiled DLL). You can even use the label control for Gradient backgrounds in the designer.
EZGUI comes with a built in set of simple graphic macros for drawing on the 3D buttons. Here is the Builder dialog in the designer:
When it comes to a more graphicly oriented application, EZGUI makes it easier than ever..
You can edit Turtle Graphic macros from within the Designer and test them out so you can see how your Turtle control will look. Save Turtle files and load them in the Designer, so you can reuse images. Turtle images are totally scalable.
Here is the Turtle builder in the designer:
Here is the Gradient Builder dialog in the designer for adding a gradient to a ownerdraw label control:
As I mentioned above, you can visually see how your Forms will look when they use a complex Region (based on a Bitmap background) in test mode.
Here is the regioned Form in edit more:
Here is the regioned Form in test mode:
The Visual Designer supports a number of graphic orientated features found in the runtime GUI engine.
For controls which can be ownerdrawn (listbox, combobox, etc.), but don't have a Builder dialog, the Designer can also generate the necessary code to get you started. You can be creating ownerdrawn listboxes, Listviews, menus, comboboxes, etc. in no time.
Using the simplified ownerdraw command set, you will be able to add fancy ownerdraw controls like these in no time:
Using the more low level ownerdraw command set you can even build customized controls like these two ownerdraw listboxes:
How about customizing the Common Dialogs ?
Can you do this using your current tools ?
Do you know how to do this via the API ?
Not only can EZGUI do things like center the common dialogs, but it can change the background colors (even use 3D brushes), resize the dialog , add new forms (with controls) to the dialog, process events for those controls and even skin the existing button controls to any customized ownerdraw look you want.
See the benefits of Integration !
By having a core Graphics engine built in, it can be used to customize all sorts of aspects of your software.
No other tool for PowerBasic has such an integrated Graphics engine which can be used for so many different things.
Sure some tools may be able to do some of the things above. But EZGUI is integrated so you can combine all sorts of features together in one app.
Now you can purchase EZGUI 4.0 Pro and save $70 (US).
That is a 28% savings on the retail price.
Last edited by Chris Boss; 21 Jul 2008, 08:56 AM.
Join Date: Feb 1999
15 Jul 2008, 10:29 PM
Some more Graphic features:
The Drag and Drop engine in EZGUI allows you to build WYSIWYG type applications.
EZGUI can handle so called "Rubberbanding" for you, like this:
EZGUI can do rubberbanding for Lines, Rectangles and Ellipses.
EZGUI can also handle dragging of controls using the drag handle control like this:
The Sprite engine allows you to define (and move) non-rectangular images.
Click this link to see Sprites displayed on a Canvas control as background: http://cwsof.com/screens/draw3.png (image is 222 KB in size)
Click this link to see Sprites Alphablended to the Canvas background and each other: http://cwsof.com/screens/draw4.png (image is 253 KB in size)
Join Date: Feb 1999
16 Jul 2008, 11:01 PM
Custom Draw and Owner Draw
Custom Draw allows you to easily define the colors and fonts for items in a Listview or Treeview control. The coding is easy.
Here is the event code for a Custom Draw Listview:
IF CMsg&=%EZ_NoCustomDraw THEN Cancel&=1 IF CMsg&=%EZ_CustomDraw THEN I&=EZ_GetCDrawItem(CVal&, SI&) SELECT CASE SI& CASE 0 EZ_SetCDrawItem CVal&, 7, 4,-1 CASE 1 EZ_SetCDrawItem CVal&, 8, 2,-1 CASE 2 EZ_SetCDrawItem CVal&, 9, 1,-1 CASE ELSE EZ_SetCDrawItem CVal&, 6, 0,-1 END SELECT END IF
Here is the event code for a Custom Draw Treeview:
IF CMsg&=%EZ_NoCustomDraw THEN Cancel&=1 IF CMsg&=%EZ_CustomDraw THEN H&=EZ_GetCDRawItem(CVal&, SI&) SELECT CASE SI& CASE 0 EZ_SetCDrawItem CVal&, 9, 4, -1 CASE 1 EZ_SetCDrawItem CVal&, 8, 1, -1 CASE 2 EZ_SetCDrawItem CVal&, 7, 2, -1 CASE ELSE EZ_SetCDrawItem CVal&, 6, 0, -1 END SELECT END IF
OwnerDraw allows you to actually draw the items in a Listview control (also Menus, Buttons, ComboBox, Listbox, Tab control support OwnerDraw).
Here is an OwnerDraw Listview control:
Another OwnerDraw Listview control:
The examples above simply show you that draw the control any way you like. You can draw Bitmaps, Text, Shapes, ImageLists, PolyBeziers, even Turtle Graphics, within a Listview item.
Here is the event code for the ownerdraw listview image above (the second one):
CASE %EZ_OwnerSize EZ_SizeListview CVal&, 4 CASE %EZ_OwnerDraw EZ_DrawListview "Form1", MyID&, CVal&, 4, 1, MProp$, 3
This Listview is using the simplified ownerdraw command set. You can fill items with Macros, that will be drawn out using the EZ_DrawListView command. Here is the fill code:
SUB FORM1_LISTVIEW1_Fill(BYVAL Mode&) LOCAL R&, C&, Tmp$, T$ IF Mode&=-1 THEN ' Initial Data FOR R&=0 TO 50 ' Rows FOR C&=0 TO 2 ' Columns Tmp$="Item "+RIGHT$("00"+LTRIM$(STR$(R&)),2)+","+STR$(C&) T$="Item "+RIGHT$("00"+TRIM$(STR$(R&)),2)+","+TRIM$(STR$(C&)) SELECT CASE C& CASE 0 Tmp$=" | | " CASE 1 Tmp$="{X}|{_}|{X}|" CASE 2 Tmp$="{1}|{2}|{3}|" CASE ELSE Tmp$="" END SELECT T$=PARSE$(Tmp$, "|", (R& MOD 3)+1)+T$ EZ_AddLVItem "Form1", %FORM1_LISTVIEW1, T$, 0, R&, C&, "" NEXT C& NEXT R& END IF END SUB
Notice the macros embeded in the items. The Macros "{X}" and "{_}" ate for Checkboxes (checked and unchecked). The Macros " " and " " are for color boxes (the # is an EZGUI color index number).
If you want to get more low level to draw the items, then you can use lower level OwnerDraw commands. The first OwnerDraw Listview above does this.
Here is the draw code for the first ownerdraw Listview above:
SUB SizeListViewItem(BYVAL CID&, BYVAL CVal&) LOCAL W&, H&, Item1&, Item2&, NW!, NH! IF EZ_StartOwnerSize(CVal&, W&, H&, Item1&, Item2&) THEN EZ_GetTextSize 7, "XXX", NW!, NH!,0 H&=INT(NH!*1.5) EZ_EndOwnerSize CVal&, W&, H& END IF END SUB ' ' SUB DrawListviewItem(BYVAL CID&, BYVAL CVal&) LOCAL hMyDC&, X2&, Y2&, IsSel&, IsGry&, IsDis&, IsChk&, IsFoc&, IsDef& LOCAL X1&, Y1&, Item1&, IsEdit&, SubItem&, SubItem2&, CP$ LOCAL SX1&, SY1&, SX2&, SY2&, CW&, AW!, AH! LOCAL IText$, IPictNum&, LVProp$ IF EZ_StartOwnerDraw(CVal&, hMyDC&, X2&, Y2&, IsSel&, IsGry&, IsDis&, IsChk&, IsFoc&, IsDef&) THEN EZ_GetODItem CVal&, X1&, Y1&, Item1&, IsEdit& CP$=EZ_GetLVColOrder("Form1", CID&,3) IF Item1&>=0 THEN SX1&=0 EZ_SaveState FOR SubItem&=0 TO 2 CW&=EZ_GetLVColWidth("Form1", CID&, SubItem&) SX2&=SX1&+CW&-1 IF IsSel& THEN EZ_Color 15, 9 ELSE IF (SubItem& MOD 2)=1 THEN EZ_Color 0, 31 ELSE EZ_Color 0, 23 END IF END IF EZ_DCDraw hMyDC&, %EZ_FILL, SX1&, Y1&, SX2&, Y2&, 1, 1 EZ_SaveState IF IsSel& THEN EZ_Color 0,0 EZ_DCDraw hMyDC&, %EZ_LINE, SX2&, Y1&, SX2&, Y2&, 1, 0 EZ_DCDraw hMyDC&, %EZ_LINE, SX1&, Y2&, SX2&, Y2&, 1, 0 EZ_RestoreState IF (SX2&-SX1&)>18 THEN EZ_DCDraw hMyDC&, %EZ_CHECK_1, SX1&+2, Y1&+2, SX1&+16, Y2&-2, 1, 0 END IF EZ_UseFont 7+SubItem& ' use different fonts SubItem2&=VAL(PARSE$(CP$,"|",SubItem&+1)) ' get actual column IF EZ_GetLVItem("Form1", CID&, IText$, IPictNum&, Item1&, SubItem2&, LVProp$ ) THEN EZ_GetTextSize 7+SubItem2&, IText$, AW!,AH!,0 IF AW!>CW& THEN EZ_SetPrintFormat 2, SX2&, Y2&, %EZ_LEFT OR %EZ_VCenter, 0 ELSE EZ_SetPrintFormat 2, SX2&, Y2&, %EZ_CENTER OR %EZ_VCenter, 0 END IF EZ_DCPrint hMyDC&, SX1&+20,Y1&, IText$ END IF SX1&=SX2&+1 NEXT SubItem& EZ_RestoreState EZ_SetPrintFormat 0,0,0,0,0 END IF EZ_EndOwnerDraw END IF END SUB
Here is the event code for that Listview:
IF CMsg&=%EZ_OwnerSize THEN SizeListViewItem CID&, CVal& END IF IF CMsg&=%EZ_OwnerDraw THEN DrawListviewItem CID&, CVal& END IF
Whether using the higher level Simplified OwnerDraw command set or the lower level OwnerDraw command set, you can customize the look of your controls in a variety of ways.
Join Date: Feb 1999
17 Jul 2008, 12:02 PM
Buttons, Buttons, Buttons !
EZGUI Provides three sets of 3D colored buttons in the Visual Designer. One is built in and the other two are implemented via plugins. You can use one set per project.
Here are the built in (default) 3D Buttons:
Here is the same buttons using the first Button Plugin:
Here is the same buttons using the second Button Plugin:
Buttons can be any color, can use a Rounded Rectangle region or an Elliptical region. You can even write your own button plugin to customize your own set of buttons for use in the Designer.
How do the plugins work ?
You write your own replacement routines for the following commands in EZGUI:
and put them in an include file. You use the lower level OwnerDraw command set in EZGUI to do this (no API needed).
Next you write a Plugin, which is simply a standard DLL using the template provided. The plugin will provide the necessary info to the Designer about code generation and it will do the actual drawing of the buttons for the design. You simply call the routines you wrote in your include file.
Here is a code plugins code (the DLL, not the actual drawing include which you would write):
' ------------------------------------------------------------------------------------------- ' Button Plugin (Type 3) ' This plugin is called when a ' a OwnerDraw Button is to be drawn. ' ' Plugins should be copied to plugins folder ! ' Change Plugin file extension to .ezp (instead of .dll) ' ' ------------------------------------------------------------------------------------------- ' ------------------------------------------------------------------------------------------- ' Copyright Christopher R. Boss, 2006 ' Alls Rights Reserved ' The code may be used ROYALTY FREE by registered EZGUI 4.0 users ! ' ------------------------------------------------------------------------------------------- #DIM ALL #DEBUG ERROR OFF ' Plugin can have any name, but must hav extension.ezp #COMPILE DLL ' once compiled change .DLL extension to .EZP #INCLUDE "..\includes\ezgui40.inc" #INCLUDE "drawbtn.inc" GLOBAL DLL_Instance& ' ------------------------------------------------------------------------------------------- ' DLL Entrance - LibMain ' ------------------------------------------------------------------------------------------- FUNCTION LIBMAIN(BYVAL hInst AS LONG, _ BYVAL RFlag AS LONG, _ BYVAL lpR AS LONG) AS LONG SELECT CASE RFlag CASE 1 ' (Where DLL starts) DLL_Instance&=hInst CASE 0 ' (Where DLL exits) CASE ELSE END SELECT LIBMAIN=1 END FUNCTION ' ------------------------------------------------------------------------------------------- ' EZGUI 3.5 PlugIn Calls ' ------------------------------------------------------------------------------------------- FUNCTION EZ_PLUGIN_INIT(PType&) EXPORT AS STRING ' ---------------------------------------- ' This function is called once to Initialize ' the PlugIn. Return the PlugIn name. ' If NULL string returned, PlugIn fails to ' Initialize. ' ---------------------------------------- PType&=3 ' Button Plugin ' --------------------------- FUNCTION="EZGUI 3D Button-A" END FUNCTION SUB EZ_PLUGIN_DRAWBUTTON (BYVAL FormName$, BYVAL CID&, BYVAL CVal&, BYVAL BGColor&, BYVAL FGColor&, BYVAL FontN&, BYVAL RType&) EXPORT ' ---------------------------------------- ' This sub is called when a button is to be drawn. ' FormName$ is Buttons parent form name ' CID& is Buttons ID number ' CVal& is CVal& of %EZ_OwnerDraw event ' BGColor& is EZGUI background color number ' FGColor& is EZGUI foreground (text) color number ' FontN& is EZGUI Font number ' RType& is buttons region Type (0 - none, 1 - ellipse, -2 - Rounded Rectangle ' EZGUI generates the region code for you ! Just draw based on the region type. ' ---------------------------------------- SELECT CASE RType& CASE 1 DrawMyButtonE FormName$, CID&, CVal&, BGColor&, FGColor&, FontN& CASE -2 DrawMyButtonRR FormName$, CID&, CVal&, BGColor&, FGColor&, FontN& CASE ELSE DrawMyButton FormName$, CID&, CVal&, BGColor&, FGColor&, FontN& END SELECT END SUB FUNCTION EZ_PLUGIN_DRAWCODE(BYVAL IData$, BYVAL Mode&, BYVAL RType&) EXPORT AS STRING LOCAL RV$, Q$, CRLF$, INC_Path$ IF Mode&=0 THEN IF RIGHT$(IData$,1) "\" THEN IData$=IData$+"\" INC_Path$=IData$ ' IData$ passes path to Designer (mode=0) ' Designer stores inc files in subfolder named : includes ' Designer stores plugin files in subfolder named: plugins END IF ' Mode&=0 if the code is the include statements after all other includes. ' Mode&=1 if the code is the actual draw code used in the Buttons %EZ_OwnerDraw event Q$=CHR$(34) CRLF$=CHR$(13)+CHR$(10) SELECT CASE Mode& CASE 0 ' return include code for drawing code RV$="#INCLUDE "+Q$+INC_Path$+"plugins\drawbtn.inc"+Q$+CRLF$ CASE 1 ' return name of draw routine only (no CRLF or parameters) ' EZGUI assumes the parameters for your drawing sub are: ' BYVAL FormName$, BYVAL CID&, BYVAL CVal&, BYVAL BGColor&, BYVAL FGColor&, BYVAL FontN& ' which are identical to the EZGUI Button drawing commands SELECT CASE RType& CASE 1 RV$="DrawMyButtonE" CASE -2 RV$="DrawMyButtonRR" CASE ELSE RV$="DrawMyButton" END SELECT CASE ELSE END SELECT FUNCTION=RV$ END FUNCTION
You can create all sorts of 3D Button Plugins for your development.
EZGUI comes with 2 plugins already, but you can write your own or simply modify the existing plugins and create new ones.
Here is the code for one of the plugins that come with EZGUI 4.0 Pro:
' ------------------------------------------------------------------------------------------- ' Copyright Christopher R. Boss, 2006 ' Alls Rights Reserved ' The code may be used ROYALTY FREE by registered EZGUI 4.0 users ! ' ------------------------------------------------------------------------------------------- SUB DrawMyButtonX(FormName$, CID&, CVal&, BGColor&, FGColor&, FontN&, BYVAL RType&) LOCAL hMyDC&, X2&, Y2&, IsSel&, IsGry&, IsDis&, IsChk&, IsFoc&, IsDef& LOCAL T$, LW&, C&, CL&, YOffset&, FC&, XOffset& , MObj&, LFlag&, LC& IF EZ_StartOwnerDraw(CVal&, hMyDC&, X2&, Y2&, IsSel&, IsGry&, IsDis&, IsChk&, IsFoc&, IsDef&) THEN YOffset&=Y2&/4 XOffset&=X2&/4 IF XOffset&>=YOffset& THEN XOffset&=YOffset& ELSE YOffset&=XOffset& END IF IF RType&=-2 THEN EZ_DefCorner -1 EZ_SaveState EZ_SaveColors 96, 99 C&=EZ_ColorVal(BGColor&,0) IF IsFoc& THEN C&=EZ_AverageColor(C&, RGB(255,255,255)) ELSE C&=EZ_AverageColor(C&, RGB(220,220,220)) END IF EZ_DefColorL 96, EZ_AverageColor(C&, RGB(32,32,32)) EZ_DefColorL 97, C& EZ_DefColorL 98, RGB(255,255,255) EZ_DefColorL 99, EZ_AverageColor(C&, RGB(255,255,255)) IF IsSel& THEN EZ_Color 0,97 EZ_DCDraw hMyDC&, %EZ_FILL, 0, 0, X2&, Y2&, 0, 1 EZ_Color 97,-1 ELSE EZ_Color 98,97 EZ_DCDrawGradient hMyDC&, 0, 1, X2&, 2*YOffset&, 2 EZ_Color 0,97 EZ_DCDraw hMyDC&, %EZ_FILL, 0, 2*YOffset&+1, X2&, Y2&-YOffset&-1, 0, 1 EZ_Color 97,96 EZ_DCDrawGradient hMyDC&, 0, Y2&-YOffset&, X2&, Y2&, 2 EZ_Color 98,97 EZ_UseGradientAngle 1 EZ_DCDrawGradient hMyDC&, 1, 0, 2*XOffset&, Y2&, 0 EZ_Color 96, 97 EZ_UseGradientAngle 1 EZ_DCDrawGradient hMyDC&, X2&-(2*XOffset&), 0, X2&, Y2&, 1 EZ_Color 97,-1 END IF SELECT CASE RType& CASE 1 EZ_DCDraw hMyDC&, %EZ_ELLIPSE, 0, 0, X2&, Y2&, 1, 0 CASE -2,2 EZ_DCDraw hMyDC&, %EZ_RRECT, 0, 0, X2&, Y2&, 1, 0 CASE ELSE EZ_DCDraw hMyDC&, %EZ_RECT, 0, 0, X2&, Y2&, 1, 0 END SELECT IF IsFoc& THEN EZ_Color 99,-1 SELECT CASE RType& CASE 1 EZ_DCDraw hMyDC&, %EZ_ELLIPSE, 2, 2, X2&-2, Y2&-2, 1, 0 CASE -2,2 EZ_DCDraw hMyDC&, %EZ_RRECT, 2, 2, X2&-2, Y2&-2, 1, 0 CASE ELSE EZ_DCDraw hMyDC&, %EZ_RECT, 2, 2, X2&-2, Y2&-2, 1, 0 END SELECT END IF EZ_Color FGColor&,-1 EZ_UseFont FontN& T$=EZ_GetText(FormName$, CID&) T$=EZ_GetText(FormName$, CID&) MObj&=EZ_GetDrawMacro(T$) IF MObj& 0 THEN EZ_DCDrawMacro hMyDC&, MObj&, 0, 0, X2&, Y2&, FGColor&, 97 ELSE LFlag&=EZ_CheckLight(T$, LC&) EZ_SetPrintFormat 2, X2&, Y2&, %EZ_Center OR %EZ_VCenter, 0 EZ_DCPrint hMyDC&, 0,0, T$ EZ_SetPrintFormat 0,0,0,0,0 IF LFlag& THEN EZ_DCDrawLight hMyDC&, 0, 0, X2&, Y2&, LC& END IF END IF EZ_RestoreColors EZ_RestoreState IF RType&=-2 THEN EZ_DefCorner -2 ' restore EZ_EndOwnerDraw END IF END SUB SUB DrawMyButton(BYVAL FormName$, BYVAL CID&, BYVAL CVal&, BYVAL BGColor&, BYVAL FGColor&, BYVAL FontN&) DrawMyButtonX FormName$, CID&, CVal&, BGColor&, FGColor&, FontN&, 0 END SUB SUB DrawMyButtonE(BYVAL FormName$, BYVAL CID&, BYVAL CVal&, BYVAL BGColor&, BYVAL FGColor&, BYVAL FontN&) DrawMyButtonX FormName$, CID&, CVal&, BGColor&, FGColor&, FontN&, 1 END SUB SUB DrawMyButtonRR(BYVAL FormName$, BYVAL CID&, BYVAL CVal&, BYVAL BGColor&, BYVAL FGColor&, BYVAL FontN&) DrawMyButtonX FormName$, CID&, CVal&, BGColor&, FGColor&, FontN&, -2 END SUB
While the code above for the plugins is Copyrighted, it can be used Royalty free by licensed users.
Join Date: Feb 1999
17 Jul 2008, 12:17 PM
One of the tough things to do with a 3D Button control is to calculate a set of colors for the image based on a single background color provided by the Designer.
Notice in the code above, EZGUI provides a command:
This command can be used with a single background color and a set of gray shades (the R,G,B values are all the same) to generate a whole set of colors within a specific color scheme.
EZGUI also provides the:
EZ_DCDrawGradient command for draw all sorts of Gradients which are perfect for drawing 3D Buttons.
commands give you the ability to support the 3D Button Macro Builder in the Designer.
The beauty of all of this is that you can work visually with all these 3D Buttons in the Designer and it benefits from the integrated Graphics engine built into EZGUI.
Even if another Designer supported OwnerDraw like EZGUI, EZGUI currently is the only one that comes with a completely integrated Graphics engine.
This is why a completely Integrated GUI engine (and designer) provides more options than other tools which are not.
Join Date: Feb 1999
21 Jul 2008, 08:58 AM
Sale extended to July 27, 2008!
This sale has been extended to July 27, 2008.
Act quickly before the sale is over.
Join Date: Feb 1999
24 Jul 2008, 02:35 PM
Only 3 1/2 days left for this sale, so act now.
Join Date: Feb 1999
25 Jul 2008, 08:35 AM
The built-in Canvas control is integrated into the main runtime and it allows you to build your own Graphic viewport for applications.
It is a real control (no limit on how many you use).
It is fully supported by the built-in graphics engine so you can draw all sorts of things.
It even has its own Sprite engine which allows you to animate the control, by adding movable, non-rectangular bitmaps (define a transparent color).
The most powerful feature is the alphablending feature for Sprites.
Here is an example:
Join Date: Feb 1999
26 Jul 2008, 12:32 AM
Some lesser known Graphic features of EZGUI 4.0 pro
Here are some interesting Graphic features in EZGUI that demonstrate the extent of its command set.
Creating unique Fonts couldn't be easier. EZGUI removes the complexities of the API to make font definition as easy as possible.
For example, lets create a new font:
EZ_DefFont 9, "Arial Black", 12.5, "VBI{90}[50%]"
Let's look at the parameters for the EZ_DefFont command:
9 - this is an EZGUI font index number so you can reference the font later
"Arial Black" - Font Face name
12.5 - Font size in Points (can be a decimal value) (a point is 1/72 of an inch)
"VBI{90}[50%]" - property string.
The property string means the following:
V - Variable width font
{90} - 90 degree rotation
[50%] - force width to 50% of the height
Here are some interest Graphic orientated commands:
This command takes two RGB color values and combines them using an average (blending the colors). This is very useful when using the system colors to create shades of the system colors. I like to use this when using ownerdraw.
N& = EZ_GetBestColorMatch (C&, N1&, N2&)
This command takes an RGB color value (C&) and then scans all the existing EZGUI colors from index N1& to N2& to find the closest match. This is useful when matching colors from an external source to find the closest one within a predefined palette of colors.
C! = EZ_ScaleToCharSize (V!, Mode$)
EZGUI uses a character based coordinate system. A character is the size of the default system font. This command allows you to convert the following coodinate systems to EZGUI character units:
EZGUI can also easily convert back and forth between pixels and character units using the functions EZ_X, EZ_Y, EZ_CX, EZ_CY .
Here is a very useful coordinate command:
NewMousePos& = EZ_ConvertMousePos (hWnd1&, hWnd2&, lParam&)
Windows often passes the mouse coordinates in the lParam value of many messages. Both the X and Y values are combined in one long value. EZGUI events use a similar way of passing the mouse coordinate. This command allows you to easy convert such an x,y coordinate from one windows client area to anothers.
To get the x,y values from a single long value, you can use the command:
EZ_GetMouseXY MousePos&, X&, Y&
EZGUI can load icons, cursors and bitmaps from disk files. Rather than have to use a full path for every such command you use in your app, you can use the command:
F$ can be either a full path (ie. "c:\somefolder") or simply a single folder name (ie. "graphics") and EZGUI will append the folder name to the applications path to create a full path, whch is a subfolder off the apps folder.
Now when ever you use an EZGUI command to load an icon, cursor or bitmap, you need only pass the function the filename. EZGUI will append the defined image folder path to the filename for the full path.
No need for a full path here.
A very useful command for calculating the end points of a line is:
EZ_CalcPoint X1&, Y1&, Length&, Degrees&, X2&, Y2&
You define the beginning point (X1&, Y1&), the length and degrees of the the line from that point and EZGUI returns the end point in X2&, Y2&.
EZGUI can draw a Polygon with the EZ_DCDraw, EZ_CDraw and EZ_LDraw command. Those commands do the drawing, but another command defines the actual polygon. EZGUI uses a relative coordinate system fro defining polygons. Meaning you don't define a unique array of points every time you want to draw a new polygon. EZGUI uses a relative box to define the polygon which is a 1 x 1 box. You define the polygon using coordinates which are decimal values within that box.
This defines an upsidedown triangle. The first coordinate is the top,left corner (0,0), The second is the top, right corner (1,0). The third is at the bottom of the area, but half way across (.5,1) and the last one is back to the beginning. This is an upsidedown triangle.
Now when the polygon is to be drawn using the other commands noted above, you will define a rectangular area to draw it in. EZGUI will then scale the polygon to the rectangle and autogenerate the correct points.
This means you can define a shape using relative coordinates and then it can be drawn, over and over again in different areas and sizes without having to manually calculate the new coordinates.
Some other interesting features are:
You can create blank Bitmaps in memory and then draw in them using the entire graphics engine. You can even create blank DIB sections and either draw in them using the graphics engine or directly access the pixel data via pointers (no need to GET/PUT data to a buffer and back).
When printing to the printer, EZGUI automatically creates an abort print job dialog for you and displays it. If you want you can hide it.
EZGUI allows you to use a Canvas control, instead of a printer so you can create your own Print Preview routines. The Canvas will accept the actual printer code for a single page (and ignore the rest).
EZGUI has the ability to autogenerate a region for the current image of a Canvas control. You simply tell EZGUI what color is the transparent color and then it will generate a region for the current image and apply that region to the Canvas control. This makes the Canvas control non-rectangular, based on the bitmap image in it.
Join Date: Feb 1999
28 Jul 2008, 09:57 AM
Sale is now over !
Thanks to those who ordered.
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 04:18 AM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.