Radial menus have started appearing in several places. I'm curious whether anyone has seen or is working on a radial menu component for Delphi? We have a concept of what we'd like, shown in the animated gif at http://jmrsoftware.delaneyjoi.com/wheel.gif. (It takes about 10 seconds for the menu animation to start.)
alt text http://jmrsoftware.delaneyjoi.com/wheel.gif
Does anyone know of a component for Delphi that has similar functionality?
Thanks
Radial or "pie" menus are underrated but are praised in HCI circles for being easy to use in a precise fashion. People find it easier to remember the path to an item on a radial menu that on a traditional linear-style menu, where the cursor needs to stay within a precise area to prevent a whole cascade of submenus from disappearing.
I've not seen a Delphi component that does it, but having coded them before in Delphi I'd recommend a package like Graphics32, perhaps deriving your pie menu from a paint box or image control that covers the entire form with a transparent overlay, and then renders/animates pie segments on top of that.
Related
I'm working with opencv and I want to do the following procedure:
Every second I check the difference between the current position of the mouse and the position it was 1 second ago.
Then I want to draw a line in my screen, from the position 1 second ago and the current position. This line should stay on the screen for 1 second until the difference is evaluated again, so the line should be renderer in the new position.
I've already done all the logics, position calculations and everything. What I want to know is how to draw a line in my screen. I wish to use my PC normally while I can see those lines, that means clicking with the mouse, keyboard events and opening windows should not stop the lines from being renderer on my screen.
How can I do that?
That isn't trivial.
You need some GUI toolkit that can show a window with the following properties:
full-screen
no window decoration (title bar...)
always-on-top
"intangible", i.e. allowing mouse and keyboard events to pass through to whatever other windows are underneath it
a working alpha channel (per-pixel transparency)
That's the general idea. Pick a popular GUI toolkit, then google around. You'll likely find ways to do each and all of those points.
I don't think OpenCV does this. Its GUI facilities are a convenience, not flexible to this degree.
I am trying to create a basic map editor for fun which consists of a scrollbox and paintbox (to draw the grid).
In the OnMouseDown event for the paintbox I create images at runtime and add them inside the scrollbox, the grid paintbox is painted above the images ( because if the grid was at the back it just would not look good ).
Here is a sample screen:
My question would solve two of my problems in one.
I need to be able to drag and drop (to move) the images around at runtime.
I also need to be able to get the X and Y position of the image to display as information.
Here is where my problem lies, to solve the problems above I first need to get the Image under the mouse cursor. But because I paint my grid (paintbox) above the images, the cursor will only ever 'see' the paintbox grid, and not the underlying images.
I did experiment with copying the paintbox grid to a TImage but it came out all wrong and I was getting out of memory errors. The size of the maps could be quite large and so putting the grid onto a bitmap is not ideal due the memory and limitations etc.
The grid must go on the top, otherwise it would look something like this:
Which hides the grid, and I don't want that to happen.
So, how can I see past the paintbox and get to the images underneath, using FindVCLWindow or something similar?
Set the Enabled property of the PaintBox to False. That will let the mouse messages go through.
Further:
In the OnMouseDown event for the PaintBox I create images at runtime and add them inside the scrollbox
Change that to the OnMouseDown event on the ScrollBox. Adjust the coordinates by ScrollBox.[Horz/Vert]Scrollbar.Position.
How can I add a shadowed background to a TLayout or image, or any control for that matter ? What is the best way to do this, without having to stack images? I've found that a TPanel should have a border property but I am not finding that property. ? Am I missing something ? Or is there a different technique I should be using ?
I am working with Delphi Xe5 building an iOS application.
See a summary of effects in FireMonkey, FireMonkey Image Effects.
Quote:
"These effects are not limited to bitmap image data; effects can be applied to the pixels of any 2D control in the user interface."
In your case, the FMX.Effects.TShadowEffect is what you are looking for.
"Beside the properties provided by TEffect, TShadowEffect provides five specific properties: Direction, Distance, Opacity, ShadowColor, and Softness."
To learn how to apply an effect to your control, see Applying_FireMonkey_Image_Effects.
When I set larger font, arrows start to grow vertically. How can I stretch them also horizontally?
The system draws both of these controls. You really ought to let the system decide how to draw them.
If you don't want to do that then you'll have to override the Paint method and draw the controls yourself. Be warned that this is non-trivial once you factor in all the possible themes that you app may encounter (Windows Classic, Windows Basic, Aero). Or you could look for a 3rd party component that has already done this.
I'm not sure this is relevant in your case and guess the answer will be downvoted for that, but did you thought of using the ScalyBy / ChangeScale of the Form/Control?
I'm looking for ideas on how to draw a skinnable "button" in a game application. If I use a fixed sprite non-vector image for the button background, then I can't size the button easily. If I write code to draw a resizable button (like Windows buttons are drawn), then the programmer has to get involved -- and it makes skinning difficult. Another option is to break the button into 9 smaller images (3x3) and stretch them all -- kindof like rounded corners are done in HTML.
Is there another "easier" way? What's the best approach?
If you really want to accomplish this, the way to do it is with texture coordinates. Much like you would make a stretchable button/panel design in HTML with a table, you simply define the UV coordinates for the corners, the top stretchable area, the bottom stretchable area, the side stretchable areas, and then the middle.
For an example of this being implemented in an XNA engine (though it's a closed source engine), see this:
http://www.flatredball.com/frb/docs/index.php?title=SpriteFrame_Tutorial
Yes. I am working on an Editor. It's a XAML-like language (or OpenLaszlo-like, if you prefer) for XNA. So the buttons can be resized by the editor. The buttons might also be resized by a style sheet.
I guess you're right that it's likely that the buttons will all be the same size in a real design. But even in a window's app, you sometimes need to make a button wider to accomodate text.
It should be possible with shaders. You would probably have to do texel lookups, but it would cut down on the number of triangles in a complex UI.