From: | Francis G. Loch |
Date: | 10 Jan 2000 at 11:06:39 |
Subject: | Re: Hello... and some questions! |
--- Lorenzo Tanganelli <tangalor@dns.etruria.it>
wrote:
> Ciao Francis,
>
> Il 06-Gen-00, Francis G. Loch ha scritto:
> > Hi Lorenzo,
>
> > This is due to a bug in the GT library. I found
> this
> > problem with my TransGraphica utility so I ended
> up
> > using the standard commands for button icons.
> Another
> > problem that I found with the GT library is that
> it
> > only allows you to have icons with 4 colours. I
> would
> > stick to the standard shapes button if I were you.
> yes... sigh! But doesn't something exist to change
> it? Doesn't exist a
> patch, a library that can change it?
There might be one available on Aminet, but I am not
aware of it.
>
> > Forgive me if I haven't mentioned the specific
> > commands for doing this, but I write these e-mails
> > from work and I don't have my Blitz manual to
> hand.
> >
> > If you would like I can send you some example code
> > using these commands.
> Yessss... I would be happy! I have learnt a few
> commands to program simply
> reading the source of many programs that I have
> found on aminet. If you
> want some codes that I have I can send you
> something. Thank you very much!
>
Here's an example source showing you how to use the
ShapeGadget function along with GadTools. This source
is a cut-down and edited version of routines used in
my TransGraphica utility. It will not work if you try
to run it as it stands. Also note that the source is
probably not as nice as it could be.
Once you have set up all of your icons, etc. you can
use the standard GadgetHit commands as you would if
you were using GTShapes.
I hope this is of use to you.
If you have any queries please don't hesitate to ask.
If you're interested in seeing TransGraphica in action
you can download it from my website. Note that it
doesn't like the new AmigaOS 3.5 very much.
;
-------------------------------------------------------------------------
; Open screen and define the colour palette
;
-------------------------------------------------------------------------
Screen 0,0,0,640,512,4,$8004,stit$,1,2
InitPalette 0,16
PalRGB 0,0,10,10,10
PalRGB 0,1,0,0,0 ; These are your standard
PalRGB 0,2,15,15,15 ; system colours
PalRGB 0,3,6,8,11
. ; Define the rest of your
. ; colours. Useful if you are
. ; using icons with >4
colours!
Use Palette 0
;
-------------------------------------------------------------------------
; Load in icons
;
-------------------------------------------------------------------------
; This section of code reads the icons from a DATA
list
; and loads them in. The icons are stored as IFF
brushes.
; The extensions mf0 and mf1 are for normal and
pressed
; button images.
Restore icon_list
Read nooficons
For i=0 To nooficons-1
Read icon$
LoadShape i*2,"data/"+icon$+".mf0"
LoadShape i*2+1,"data/"+icon$+".mf1"
Next
icon_list:
Data 3,"open_file","save_file","print"
;
-------------------------------------------------------------------------
; Define screen items
;
-------------------------------------------------------------------------
; Defines some GadTools menus
GTMenuTitle 0,0,"Project"
GTMenuItem 0,0,0,0,"Load ASCII file...","L"
GTMenuItem 0,0,0,1,"Save as IFF-ILBM...","S"
GTMenuItem 0,0,0,2
GTMenuItem 0,0,0,3,"Information...","I"
GTMenuItem 0,0,0,4,"About...","?"
GTMenuItem 0,0,0,5
GTMenuItem 0,0,0,6,"Quit","Q"
GTMenuTitle 0,1,"Image"
GTMenuItem 0,0,1,0,"Increase scale",">"
GTMenuItem 0,0,1,1,"Decrease scale","<"
GTMenuItem 0,0,1,2
GTMenuItem 0,1,1,3,"1x2 aspect ratio","N"
GTMenuItem 0,0,1,4
GTMenuItem 0,1,1,5,"Reverse video","R"
GTMenuTitle 0,2,"Misc"
GTMenuItem 0,0,2,0,"TAB size...","T"
; Defines the positions of our icons.
;
; The syntax is:
; ShapeGadget
GadList#,X,Y,Flags,GadID#,Image1,Image2
ShapeGadget 0,9,5+bar_y,0,0,0,1
ShapeGadget 0,43,5+bar_y,0,1,2,3
ShapeGadget 0,77,5+bar_y,0,2,4,5
ShapeGadget 0,111,5+bar_y,0,3,6,7
ShapeGadget 0,145,5+bar_y,0,4,8,9
ShapeGadget 0,179,5+bar_y,0,5,10,11
; Define a GadTools cycle list
GTCycle 0,6,78,bar_y*2+11,163,bar_y+2,"ASCII
filter:",0,filterlist$,default_filter
; Set up the window
Window
1,0,bar_y,640,ScreenHeight-bar_y,$201108,"",1,2,0
GTSetMenu 0
AttachGTList 0,1
; Draw the icon gadgets
For gad=0 To 6
Redraw 1,gad
Next
=====
e-mail:- fgloch@yahoo.com
web-site:- http://www.geocities.com/fgloch
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie