Wow I just reread my post and it doesn't make sense to me ...
Here is my code. When btnHand pressed I want to change thte cursor to a hand cursor (i.e. cursorhand.png) ... I hide the mouse but instead of the hand cursor being displayed nothing get's displayed. I'm just wandering if you have to do anything different when using a window created with:
Window=createWindow(0,0,1200,800,"ES ... blah blah",WINDOW_NORMAL,0,1,Main)
Let me know if there is something fundamentally wrong but if it is a syntax or simple coding error yell at me to check my code before posting.
startBlue "",""
`Global Variable Declarations for Gadgets
`----------------------------------------
global pnlMain
global pnlDisplay
global btnClose
global btnHand
global Window
global menu
global smenuFile
global smenuEdit
global smenuHelp
global tBar1
global tbar1Over
`Menu Gloals
`-----------
rem global Main
createUI()
createMainMenu()
load image "handcursor.png",10,1
do
getEvent
if eventType()=MOUSE_CLICK
tbar1Over=getToolbarItem(tbar1)
rem message str$(tbar1Over)
select getToolbarItem(tbar1)+20
case 20 ` New
message "You selected New from Toolbar"
endcase
case 21 ` Open
message "You selected Open from Toolbar"
endcase
case 22 ` Save
message "You selected Save from Toolbar"
endcase
case 23 ` Cut
message "You selected Cut from Toolbar"
endcase
case 24 ` Copy
message "You selected Copy from Toolbar"
endcase
case 25 ` Paste
message "You selected Paste from Toolbar"
endcase
case 26 ` Undo
message "You selected Undo from Toolbar"
endcase
case 27 ` Redo
message "You selected Redo from Toolbar"
endcase
case 28 ` Delete
message "You selected Delete from
Toolbar"
endcase
case 29 ` Print Preview
message "You selected Print Preview from
Toolbar"
endcase
case 30 ` Properties
message "You selected Properties from
Toolbar"
endcase
case 31 ` Help
message "You selected Help from Toolbar"
endcase
case 32 ` Replace
message "You selected Replace from
Toolbar"
endcase
case 33 ` Print
message "You selected Print from Toolbar"
endcase
endselect
if eventSource()=btnHand
rem message "You selected Hand button"
rem change mouse 1
hide mouse
paste image 10, mousePosX(), mousePosY(),1
endif
if eventSource()=btnClose
end
endif
if eventData()=20
message "You selected Open tool bar
button"
endif
endif
if eventType()=MENU_CLICK
select eventData()
case 112 `Cut
message "You selected Cut from Edit menu"
endcase
case 111 `Redo
message "You selected Redo from Edit menu"
endcase
case 110 `Undo
message "You selected Undo from Edit menu"
endcase
case 109 `About
message "This is a simple version of ES
software"
endcase
case 107 `edit
message "You selected Edit from Edit"
endcase
case 106 `Quit
end
endcase
case 105 `Close
rem setMenuItemChecked demoMenu,5,not
getMenuItemChecked(demoMenu,5)
message "You selected Close from File"
endcase
case 104 `Save as ...
rem setMenuItemRadio demoMenu,6,7,6
message "You selected Save as ... from
File"
endcase
case 103 `Save
rem setMenuItemRadio demoMenu,6,7,7
message "You selected Save from File"
endcase
case 102 `Open
message "You selected Open from File"
rem case 2 `Disable File Menu
rem disable=not
getMenuItemChecked(demoMenu,8)
rem setMenuItemChecked demoMenu,8,disable
rem setMenuItemEnabled mainMenu,3,not
disable
endcase
case 101 `New
message "You selected New from File"
endcase
endselect
endif
if eventType()=WINDOW_CLOSE
if eventSource()=Window
if questionMessage("Do you wish to
exit?","Exit?")=1
end
endif
else
warningMessage "Click the X button on the
main window to exit the program."
endif
endif
loop
`Create User Interface
`---------------------
function createUI()
If Not GUI_CONSTANTS Then errorMessage "GUI
Constants not defined. Please include gui.dba when
you compile" : end
rem Main=createMenu(0)
dtHandle=desktopWindow()
dtWidth=gadgetWidth(dtHandle)
dtHeight=gadgetHeight(dtHandle)
Window=createWindow(0,0,1200,800,"ES ... blah
blah",WINDOW_NORMAL,0,1,Main)
rem Window=createWindow(0,0,dtWidth,dtHeight,"ES
... blah blah",WINDOW_NORMAL,0,1,Main)
pnlDisplay=createPanel(300,80,850,600,Window)
setPanelBorderStyle pnlDisplay,3
btnHand=createButton(20,525,75,25,"Hand",0,Window)
btnClose=createButton(20,552,75,25,"Close",0,Window)
canvas1=createCanvas(0,0,840,590,pnlDIsplay)
tbar1=createToolbar(Window)
addStandardToolbarButtons tbar1
addToolbarButton tbar1,TOOLBAR_NEW,20,"New"
addToolbarButton tbar1,TOOLBAR_OPEN,21,"Open"
addToolbarButton tbar1,TOOLBAR_SAVE,22,"Save"
addToolbarButton tbar1,TOOLBAR_CUT,23,"Cut"
addToolbarButton tbar1,TOOLBAR_COPY,24,"Copy"
addToolbarButton tbar1,TOOLBAR_PASTE,25,"Paste"
addToolbarButton tbar1,TOOLBAR_UNDO,26,"Undo"
addToolbarButton tbar1,TOOLBAR_REDO,27,"Redo"
addToolbarButton
tbar1,TOOLBAR_DELETE,28,"Delete"
addToolbarButton
tbar1,TOOLBAR_PRINTPREVIEW,29,"Print Preview"
addToolbarButton
tbar1,TOOLBAR_PROPERTIES,30,"Properties"
addToolbarButton tbar1,TOOLBAR_HELP,31,"Help"
addToolbarButton
tbar1,TOOLBAR_REPLACE,32,"Replace"
addToolbarButton tbar1,TOOLBAR_PRINT,33,"Print"
endfunction
`Create Main Menu
`----------------
function createMainMenu()
menu=createMenu(Window)
addMenuItem menu,"File",100
smenuFile=createSubMenu(menu,100)
addMenuItem smenuFile,"New",101
addMenuItem smenuFile,"Open",102
addMenuSplitter smenuFile
addMenuItem smenuFile,"Save",103
addMenuItem smenuFile,"Save as ...",104
addMenuItem smenuFile,"Close",105
addMenuSplitter smenuFile
addMenuItem smenuFile,"Quit",106
addMenuItem menu,"Edit",107
smenuEdit=createSubMenu(menu,107)
addMenuItem smenuEdit,"Undo",110
addMenuItem smenuEdit,"Redo",111
addMenuSplitter smenuEdit
addMenuItem smenuEdit,"Cut",112
addMenuItem smenuEdit,"Copy",113
addMenuItem smenuEdit,"Paste",114
addMenuItem smenuEdit,"Select All",115
addMenuItem menu,"Help",108
smenuHelp=createSubMenu(menu,108)
addMenuItem smenuHelp,"About",109
rem menuEdit=createSubMenu(menu,2) this creates an
arrow for further menu submenus!!!!
rem menuHelp=createSubMenu(menu,3)
endfunction
I am building a windowed mesh editor. Do I use the canvas gadget to draw into (i.e. how do I specify where to draw things in my window)?
Thanks in advance and I'm sorry if previous post was confusing!
~think of something funny ... come on, come on~