Jump to content


Photo

[bbTCL] The Windrose Interface


  • Please log in to reply
2 replies to this topic

#1 sitalk

sitalk

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 29 March 2015 - 11:16 PM

(Refer to http://blackbox4wind...lackbox/?p=2941 for installing and using bbTCL in bbZero x64)

 

Now that bbTCL too is compiled on x64 (I still can't believe it :wub: ) I'm updating my old scripts and this time I'll share them while I'm rebuilding my customizations. :)

 

Here's the first one, I called this "The Windrose" because of its resemblance with an actual wind/compass rose.

 

Posted Image

 

It's activated by middle-clicking on the desktop but you can obviously set it to any other combination in extensions.rc.

 

The Windrose consists of a 8 button BBInterface element that acts just like the regular right-click menu:

- it's called with a click on the desktop

- it closes when it looses focus

- it pops out just under the cursor (thanks to TCL and Twapi)

 

It works like this: the BBInterface frame holding the buttons is transparent and set to hide when it looses focus, in extensions.rc the middle-click triggers my TCL function via bro@m, the function finds the mouse coordinates with the help of Twapi, places the still invisible BBInterface element in that point of the screen and finally un-hides the BBInterface frame.

 

This is the TCL script:

proc OpenWindrose {} {    # Use with:    # @tcl-bb eval OpenWindrose    set CursorXY [twapi::GetCursorPos]    set CursorPos [split "$CursorXY" " "]    set CursorX [lindex $CursorPos 0]    set CursorY [lindex $CursorPos 1]    # the BBInterface frame is 80x80, hence I'm subtracting 40 from the cursor position to have it centered    tcl-bb::broam "@BBInterface Control SetWindowProperty Windrose X [expr $CursorX-40]"    tcl-bb::broam "@BBInterface Control SetWindowProperty Windrose Y [expr $CursorY-40]"    tcl-bb::broam "@BBInterface Control SetWindowProperty Windrose IsVisible true"}

How I call it in extensions.rc:

blackbox.desktop.MidClick: @tcl-bb eval OpenWindrose

The contents of BBInterface.rc are too long, but you will find the entire file in the attached zip.

Of course you can use your own BBInterface element as long it's set to close on focus loss.

 

In my case I designed this compass like element that pops out around the mouse cursor to have access to 8 different buttons each of them at the same distance from the center, this saves quite a lot of mouse movement!

The buttons open regular blackbox menus (placed in the /menus/ folder) if left-clicked, while the right-click opens their .rc file in the text editor.

 

Enjoy!!

 

Attached File  TheWindrose.zip   6.29KB   24 downloads


  • pitkon and Paz like this

#2 pitkon

pitkon

    Administrator

  • Head Administrator
  • 1,210 posts
  • LocationAthens & Nafplio, Greece

Posted 30 March 2015 - 05:57 AM

Great work, sitalk! Hope this is one of a series...


  • sitalk likes this

#3 sitalk

sitalk

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 30 March 2015 - 07:42 AM

It will be, I'm already working on the next one. :cool:


  • pitkon likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users