how to implement this hierarchical UI found in iPad in Delphi? - delphi

Check the screenshot below from Omnigroup, note the nested cards, how do you think we can implement a similar one in Delphi? Custom draw Virtual treeview? Any other hints? Thanks!

Seems to me that nested panels with captions would do the job nicely. If you want something more or less ready made, TMS Software's TAdvToolPanel comes to mind. Haven't used them for this kind of thing, but they are nestable, so you should be able to get something working fairly quickly.

An owner draw treeview might do the job. You could look at Virtual Treeview which is an open source component (and according to another SO question on of the best).

Related

Windows Phone Mango - ListBox or LongListSelector?

Say if I need to display a list with lots and lots of records, which control is better? Or shall I say, which control has a better scrolling experience?
I've seen a lot of people reporting issues on this LongListSelector, is it really too buggy to use?
Hope someone can shed some light on this for me. Thanks in adv.
Xin
If you don't need grouping, I wouldn't use the LongListSelector. The virtualization support is easier to use/manage with a regular ListBox.
And as of Mango, the ListBox performance issues are no longer a issue. You get smooth scrolling with both.
So I think you should stick to the ListBox.
The LongListSelector is used when you want to do more stuff with your list instead of just showing plain list items. LongListSelector supports grouping, which again supports easily jumping to another group. Both have visualization, so if you don´t need/want that, I would go for a simple ItemsControl and a scrollviewer(which is built in in the listbox and longlistselector).

Draw and manipulate shapes at run time

What's the best way to draw shapes interactively at run time using Delphi? I need to be able to select, drag and resize the shapes. This will be used to mark up existing images and documents.
This looks like a good starting point, but I'm wondering if there's a more complete library (preferably free) available that will save some time.
Update:
If you're going with a custom solution from scratch, I've seen another example on Delphi Central that might be an even better starting point.
I will recommend you, read some links on my site. Are explained and all the source code is available; You can see and get some usefull for you.
Plugin system in Delphi - Part 2
Not directly what you need, is a plugin system for Delphi. But all the samples are based on a drawing tool that uses Shapes (Creating, selecting, resizing). You can review the code and extract what you need.
Sample manipulating of "Maps and Figures"
Sample of how to create, select and move components at runtime (in this case with TImage).
- Select shapes visually: Shows different ways to select shapes visually.
The web is in Spanish, but you can generate an authomatic translation on the web itself.
Anyway the code is commented.
Regards.
Excuse-me for my bad english.
One freeware option would be TssControlSizer. Just change the "control" property to the control you want to manipulate resize/move.
Not sure if you've moved on now with this Bruce but if you haven't, it might be worth looking at TMS Components Diagram Studio - it's certainly cheap, and looks quite powerful from the demo.
I would use Flex Graphics (commercial, $499 for one developer, with sources, $1500 for site-license, with source code). When I bought it, it was a lot less than that. So I guess, I wouldn't pay that now. It's a lightweight 'drawing/cad' package.
But as I already own it, I could import a page from the original document as an image, perhaps rendered in PNG or WMF, and then mark it up with lines, etc.
You could think of it as a light "cad" package. It has most primitive shapes, and you can easily create your own new objects or shapes in Delphi classes, that could be "smart shapes" like the ones in Visio.
http://www.flex-graphics.com/
Another commercial component set that I have heard only good things about is TRichView. They have a TRichViewEdit that looks like you could emulate a document markup environment easily with it.
Please check here:
TCAD -2d graphics component for delphi
http://www.codeidea.com
wish can help you.

Seeking floorplan design VCL toolbar

I'm looking for a VCL component for C++ builder. It should preferably have a toolbar with drag & drop functionality.
I want to define a building or area (which might not be rectangular) and split it into "rooms" (or areas, or whatever you want to call them). And I want to be able to put "doorways" (or passages, etc) from a room into its neighbours.
is there such a thing? Preferably free.
Thanks.
In case anyone wants to know the answer, I have verified with TMS that the diagram studio can indeed do this.
Although they said "You can use TMS Diagram Studio for that, it’s not that complicated to create new custom blocks, like L-shaped rooms", so I still need to verify that it can handle triangles & lost parrots (polygons).
Not that it is specifically built for room designing, but my best guess is that it is the closes you'll get without having to create the components yourself. Anyway TMS have a component pack called Diagram Studio. This allows you to add functionality to your application that somewhat simulates that of Microsoft Visio and other programs.
I don't know if this was truly what you wanted, but even though I haven't tried it myself my guess is that you can create your own room and door like shapes to be placed. It might worth a look. Atleast the feature list has this:

Where should I begin when building a component?

I am looking to build my own component and have no idea where to begin. I have some Delphi books but they are old and outdated, and am looking for some recommendations on tutorials/books to help me do this. The component will be pretty simple, basically 2 labels and an image. I need hundreds of these in an array, so I thought a component would be the best route. The text will adjust based on width etc, and have some mouseover events. So basically, where do I begin?
I am using Delphi 2009, this will be a win32 app.
Thanks!
You can order Ray Konopka's book Dev. Custom Delphi 3 Components - PDF for 25$. It's a specialized book on the subject and very good for a beginner too.
The main principles behind developing components is:
Whether the component is visual or
not (Does it need a Canvas to paint on)
Does it need a window handle or not (visual or non-visual)
Once you answered those questions you can look at Delphi's source code for examples.
As far as I know, Delphi Component Design, by Danny Thorpe, is still the best book on the subject. Component design hasn't changed significantly in the last 15 years, so whatever books you have probably aren't as outdated as you think. There are three things to keep in mind while reading older references:
Names of certain units have changed. There's no DsgnIDE anymore, for example. It's DesignIDE instead.
Design-time code is strictly separated from run-time code now. This means you can't use DesignIDE in your component's unit, or else you're barred from using run-time packages. Older Delphi versions didn't have this technical restriction (although it's always been a legal restriction), so old code examples you find might need to change a little bit.
Strings are Unicode now, so as with all old code examples you find, there might be some invalid assumptions about character sizes that you'll need to recognize.
The biggest obstacle to writing components is that you're expected to use various protected members of the classes you descend from, but those frequently aren't documented, so you'll have to be much more willing to go read the VCL source code for examples of how various methods are used.
The easiest way to do what you want is to create a new form. Drop the labels and image and arrange them the way you want; if it suits your need, put them on a panel so they can be moved around as a unit.
Select all the components you want included (and including the panel if you chose to use one), and then click the Component item on the IDE's main menu, and select the "Create Component Template". (It's only enabled if you have selected components on the current form.) A dialog will appear asking you for a name for the new component, and the Component Palette page on which you want it to appear.
Take a look at this article, which describes how to build new components made up of a group of existing components.
Don't worry about your books being old.
Just about everything from the old days still works fine and what little doesn't is generally due to name conflicts or the addition of Unicode in the 2009 version.
They aren't Microsoft, they don't go breaking old code without good reason. In fact, take some code from the old DOS days--assuming it doesn't try to manipulate the screen it's likely to run with minimal fixup.
Don't worry about your old books! Since v3, Delphi hasn't changed much. This is why most of the programs compiled with D3 still compiles in D7 or even newer versions. And if it doesn't compile, probably you need to change a line or two, here and then.
I would recommend you to search other VERY simple components on Internet and see how they are made. Then make your own and post it here. Let other take a look at it and suggest improvements or spot bugs.
About your control's design:
1) maybe you DON'T need those two labels. You can just paint the text directly on the image. If you have lots of those components as you say, you may save a little bit of memory.
2) you may NOT want to have lots and lots and lots of images loading in one form. The overhead may be significant. What you can do is to load the pictures ONLY in images that are visible on screen - and you will put on screen ONLY 5-10 images (or whatever number of images you can show on the form without going out of screen). As the user scrolls down, you keep the same same TImage controls on screen but you load new (next) images in them.
3) You may not want to store labels and TImage in an array (I suppose it is an TImage because it seems you want to show them on the screen else you won't need labels - you need to explain your problem in more details if I got it wrong). But you can store a TBitmap and the text (that you want to display in labels) instead.
So, you may need to calculate how much CPU/disk overhead your hundreds of controls will create and how much memory they need. If you stay well under 1GB and the loading time is under 10 seconds, then it is relatively ok. IF not, you may want to think about your control's design before starting to actually implement it.
Hope this was helpful.
See ya.

What librairies exists to create "moving/living" UI in delphi?

While reading delphifeeds yesterday I discovered delQuery, which allows one to get some nice animation on his form very simply.
I would like to know if there are any other libraries of that kind out there and what experience you had with them ?
(I'm trying to find a way to make my application more alive in terms of GUI; buttons that grow when you hover them, that kind of animations but with a nice programmatic interface)
Do you mean something like Billenium Effects?
(source: billeniumsoft.com)
There is CrossGL at http://www.crossgl.com/

Resources