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?
Related
I'm having a segment control design like this
How to design my segments so that the selected one should look like the "ALL" like in the image above. What I could think of to use different images on selection but if I do that then some part of the curve which is going in "Others" won't be visible. Any suggestion on designing UISegmentControl like this ?
I have two suggestions:
Find an alternative approach that avoids this.
A lot of apps try to add delight by designing custom components and UI when actually it doesn't really add that much to the app. At worst you might frustrate people by using non-standard components that don't work the way they expect, or increase cognitive load as they're trying to use you're app.
Go 100% with a custom subclass.
Don't just settle for setting a static background image, but invest in creating a component that not only looks like this in a selected state, but also provides animations as people change the selected item.
This is going to be a fair amount of work, but would be something like this:
subclassing UISegmentedController -- it provides the base of the functionality that you're looking for which is good;
adding a new CAShapeLayer as to the controls background layer
figuring out a dynamic bezier curve that can update for all your states (will probably end up having control points for each segment) you might be able to do this by hand, but I'd have to use a tool like PaintCode to generate the bezier curve code, and Illustrator to make the initial curve
add listeners for event changes of the segment changing, and recalculate the curve control points as needed
The positive note of this is that the path property on CAShapeLayer is animatable, so when the segment changes and the curve updates the animation will probably be the easiest part!
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.
I need to have a few buttons in my iPhone app (which may be then ported to iPad). I know at least 2 methods for making such buttons:
1. Using usual UIButton with an image as a background which can be drawn in any graphics editor.
2. Subclassing UIButton and implementing own drawRect: method using CoreGraphics tools.
I don't know why, but I tend to use the second one, since it seems to be more difficult and lower performing.
Am I right thinking that when implementing the button drawing programmatically, it becomes "cross platform" so that you don't need several icons for different resolutions?
If that is really simple icon, some bezier curve or circle filled with color. Will it still preform slower than an image-button?
And does somebody know any tool which has a graphical interface for drawing a vector image, and than converts it to the CoreGraphics code which one can paste into the drawRect: method?
Thank you.
Don't worry for using drawRect. Unlike Windows, iOS caches the results into a bitmap and will only redraw it when the dimensions of the view change (which is what you actually want - since you want to scale it again).
As for a vector app, you can use Opacity. It has an option to export the icon into CoreGraphics source code: http://likethought.com/opacity/
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.
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.