07.05.2015 Views

Bronze Edition Guide - True BASIC

Bronze Edition Guide - True BASIC

Bronze Edition Guide - True BASIC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16. Graphics 133<br />

as push buttons, edit fields and list buttons, and logical windows are where you use all<br />

the other <strong>True</strong><strong>BASIC</strong> features such as PRINT, PLOT and image handing statements<br />

such as BOX SHOW.<br />

It will help you to visualize how things will appear on the monitor screen if you think<br />

of the physical window as being on top. For example, if you color an area of the logical<br />

window with a BOX AREA statement, then you place a push button in the physical<br />

window, the button will appear on top of the colored area. If you change the colored<br />

area with another BOX AREA statement, then the button will still be on top.<br />

The size and location of all windows are defined by four co-ordinates in this order;<br />

left, right, bottom, top<br />

The co-ordinates for windows are always relative to the whole screen.<br />

The co-ordinates for objects inside windows are always relative to the window.<br />

The final concept that you need to get your head around is that all windows and all<br />

objects inside windows each have a unique identity number. The reason why we need<br />

identities is again very simple. Suppose you have several push buttons labelled QUIT,<br />

CANCEL and SUBMIT, then you will want to know which of them the user has clicked<br />

on. The TC_event routine will tell you that a button has been pressed and it also gives<br />

the ID number of the button. If you have created multiple windows, then TC_event<br />

will also tell you the ID of the window the user is currently working with. The most<br />

difficult concept to grasp is that you don’t need to know the value of the ID number,<br />

because you can use a variable name instead. You are free to use any variable name<br />

you like. Suppose you have a button that is labelled QUIT, then you might use the<br />

variable name quit as the ID for this button.<br />

Remember, that there is nothing magical or mystical about windows and the objects<br />

inside them. They are just graphical images painted on the screen. However, behind<br />

the scenes, there is a great deal of code that makes the object appear to react in a<br />

particular way when you click the mouse inside the perimeter of the object. Take for<br />

example a simple push button, which you create with just one very simple line of code:<br />

CALL TC_PushBtn_create(id,”LABEL”,xl,xr,yb,yt)<br />

You don’t need to worry about all the code that paints a rectangular area of the screen<br />

gray, and works out where the center is so that the word LABEL is printed in the<br />

middle in black. Nor do you have to concern yourself with working out how to color the<br />

edges of the rectangle to give the button a 3D effect of standing proud of the<br />

background using shadows on the bottom and right hand edges. When you click the<br />

button these shadows are reversed momentarily to give the impression the button has<br />

been pressed. All this code has been done for you in the library module <strong>Bronze</strong>TC.<br />

Until now the output from your programs has been displayed on the screen in the<br />

default font, over which you had no control. <strong>Bronze</strong>TC now gives you control over the<br />

font, not just in the default window, but all windows, e.g.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!