It is currently Thu Nov 23, 2017 12:02 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Canvas_CustomImageCursor
PostPosted: Fri Oct 06, 2017 8:15 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Nov 25, 2013 6:41 am
Posts: 607
Code:
#PB_Canvas_CustomImageCursor = 14

Procedure CanvasCustomCursor(ImageID, X = 0, Y = 0)
  If ImageID
    CompilerSelect #PB_Compiler_OS
      CompilerCase #PB_OS_Windows
        Protected hCursor, Cursor.ICONINFO
        Cursor\fIcon = 0
        Cursor\xHotspot = X
        Cursor\yHotspot = Y
        Cursor\hbmMask = ImageID
        Cursor\hbmColor = ImageID
        hCursor = CreateIconIndirect_(Cursor)
        ProcedureReturn hCursor
       
      CompilerCase #PB_OS_Linux
        Protected *Cursor.GdkCursor
        *Cursor = gdk_cursor_new_from_pixbuf_(gdk_display_get_default_(), ImageID, X, Y)
        ProcedureReturn *Cursor
       
    CompilerEndSelect
  EndIf
EndProcedure 

ProcedureDLL u_SetGadgetAttribute(Gadget, Attribute, Value)
  Protected Result
 
  If IsGadget(Gadget)
    If Attribute = #PB_Canvas_CustomImageCursor
      SetGadgetAttribute(Gadget, #PB_Canvas_CustomImageCursor, CanvasCustomCursor(Value))
    Else
      SetGadgetAttribute(Gadget, #PB_Canvas_CustomCursor, Value)
    EndIf
  EndIf
 
  ProcedureReturn Result
EndProcedure

Macro SetGadgetAttribute(Gadget, Attribute, Value) : u_SetGadgetAttribute(Gadget, Attribute, Value) : EndMacro


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye