Icon in header row for column setup - delphi

I would like to add an icon to the header of my data grid as it is done in Thunderbird.
There is an icon that is above the vertical scrollbar, no matter the position of the horizontal scrollbar. This icon allows the setup of the columns.
In Delphi there a lot of different grid components, that allow customizations and adding icons to there cells / header cells. But I could not find any component that has an area above the vertical scrollbar that is fixed, which when clicked allows some action. I could even use the VirtualTreeView component to emulate the grid, if it turns out to be easier to customize that component.
I am looking for some guidance on what need to be done to get that functionality.
Thanks,
Thomas

VirtualTreeView in Listbox mode would be nice, because of it's speed, great documentation and ease use in MVC-like patterns. Delphi tempts to store data in the visual components themselves, which letter causes troubles. While VTW allwos the same, it also allows to acutally separate data from GUI, and i like it.
But i am surprised by your claim "which when clicked allows some action.".
Even most basic components allow it:
http://docwiki.embarcadero.com/Libraries/XE2/en/Vcl.Grids.TCustomGrid.OnFixedCellClick
So could you make more detaiils, why you cannot use standard components ? with screenshot and editors, how u want it rendered, where you want to click and what kind of action should happen ?

Related

Resizable columns / panels for content in jquery?

does any one know if there is an example available for sliding panels in jquery? If so, can someone send me a link? This is what I want to accomplish.
On my main screen I want to have three divisions. One right column that covers half the screen and then the left column divided in two rows. I want to expand and/or shrink the right column and/or left column and/or the top row in the left column and/or the bottom row in the left column.
Think og it as an IDE with the left side of the coding area and right side as project explorer and the properties. The coder would like to see any three of the sections at once or would like to expand each working area.
I am looking for a jquery solution for such!
Thanks
Sounds like the way jsfiddle.net works
This is available as a plugin. http://docs.jquery.com/UI/Resizable
You could also use the jQuery splitter plugin: http://www.methvin.com/splitter/
Also see (2011): http://jcubic.wordpress.com/2011/03/06/jquery-splitter-split-container/
Flexigrid is a new (2012) option: http://flexigrid.info/
The most robust solution for this is to use the jQuery layout plugin. You can find it here: http://layout.jquery-dev.net/

How make a control that look like the "download" dialog of firefox

I have a application that like firefox, can be enhanced from plugins available from internet.
Now, I want to provide in Delphi (2010) a dialog similar to the download from firefox. I have no skills in build graphical controls.
Using the standard controls of Delphi, what could be the best way... using a TListView/TStringGrid with custom draw or...
The idea is show a icon in the left, a title with subtitle with 1-3 lines on the middle and date/version on the right. That row must be selectable and that is all.
For the UI part,
The easiest way: Use TNextGrid in "Slide view" from bergsoft. It's one of my favorite VCL controls. Check this screenshot:
http://www.bergsoft.net/res/screenshots/next-grid/slides-style.gif
The most flexible way: Use TVirtualStreeTree with custom draw, but it'll take some time to get use to that most powerful tree view control and apply a custom draw.
The Most promising way: Use TMS software's advanced poly list (in beta stage currently), check the Screenshots in the following page and it's very nice looking!:
http://www.tmssoftware.com/site/advpolylist.asp
use VirtualStringTree from SoftGems.
Use TFrame to create a custom control for one download, and then reuse it.
Use a TDataSet descendant (eg. TClientDataSet, JVCL's TjvMemoryData or any other dataset you like) to have a table with all the fields needed to describe your download. For example:
Plugin_Name - Char(255)
Plugin_Icon - Blob
Downloaded_Size - Int64
Total_Size - Int64
//etc.
(Of course the above fields are provided just as an example - the actual fields are up to you).
After this, connect a TDataSource to your table and use an TDBCtrlGrid to show your data as you wish. For the above example, you can put on your record a TDBLabel, TDBImage, TjvDBProgressBar (unfortunately we don't have a data-aware gauge shipped with Delphi) etc. all these connected to the appropriate fields.
In this way you can simulate a list (if you set TDBCtrlGrid's Column property to 1) with a custom layout in which you can do select, add, delete etc.
HTH

Fluid Form Layout in Delphi

We have developed a software. In this software we are show and hiding a few controls on various input screens depending on various situations.
When we hid a control what happens is that the space occupied by that control is left as it is and layout looks very bad at times esp. in screens that have larger numbers of controls. Our client does not like this and has asked us to do something about this.
My question:
Is there some way by which we can create Fluid Layouts so that when a control is hidden the rest of the controls automatically adjusts themselves to fill the empty space left by the control hidden and when the control is show they should automatically make way for the control and adjust themselves accordingly.
I know we can achieve this by coding but that will require a lot of code in each screen for adjusting the layout. I am looking something which will reduce coding in each screen as there are 80+ screens.
Please suggest some way which is less error pron and can get rid of unnecessary coding in each input screen.
I think your best option is to use a component that handles the layout of your vcl controls on your form in runtime (depending on the conditions that you define). I recommend you try the Devexpress ExpressLayout Control
you can find two great demo videos here
ExpressLayout Control - How to Customize Layout Views
ExpressLayout Control - Create and Customize a Simple Layout
(source: devexpress.com)
You can check these features
Auto-Management - Control groups and individual control elements are automatically managed by the Layout Control. You never worry about pixel-by-pixel positioning.
Form auto-sizing - The form can be automatically resized to fit its contents best.
Bye.
Now, I'm not sure how complex layout you have, but I guess you can use TFlowPanel and/or TGridPanel for this. Flowpanel has a nice handling of components that change visiblity. I'm not sure how well gridpanel handles the same...
What kind of controls are you dynamically hiding, and what do you mean with auto fill space?
I do not know if it is as this simple: place controls on panels, and use align alTop/alClient/alBottom. When you hide a panel, all other panels will move automatically up.
One problem though: if you want to show a panel again, the order of panels can sometimes be screwed up... Can be fixed by manually setting .Top property, or "hide" by setting .Height := 1;
What I would do with a complex layout is actually split it up into several tabs. This has two advantages. It simplifies the form layout, and allows you to show and hide whole tabs depending on choices made in other tabs.
Raize Components have a TRzFlowPanel UI component. Does exactly what you're after.
Use TRzFlowPanel to put an empty flow panel on a form. The major difference between a traditional panel and a flow panel is the way in which controls are placed. With a traditional panel, you place a control (such as a button) in a specific location. You can freely move that control to any location within the panel using the mouse. In a flow panel, each control is placed in a specific location, regardless of where you place it with the mouse. The automatic location is controlled by the FlowStyle property. For example, using the default FlowStyle property of LeftRightTopBottom, the first control you add to the flow panel snaps to the top left corner. The second control that you add snaps next to the first control, and so on.

What design alternatives are there for nested page controls?

In our primary application, we have a form that will allow us to do cross tab analysis of data in four different ways. Presently, each analysis appears in its own page of a PageControl on the screen. Now, upper management would like us to add in a historical aspect to the form, which in other areas we would use a PageControl to do, but nesting two of them seems like a bad idea to display the periods and analyses tabs stacked on top of each other. Does anyone have any suggestions as to how we could re-work this to look decent and work well? Thanks.
What about using the TTabset control along the bottom of the form to allow switching between the historical periods and the current data? I would also make sure that there was a visual difference in how the data is presented for historical vs current data. Like use an off grey cell background for historical data.
Use an small (horizontal) TTabSet with a vertical one.
See here (you can click on the picture to zoom). The TTabSet is shipped OOTB with Delphi. The vertical one can be written very easily if your requirements are low. If you want, I can share the code. But if you want a better vertical tab set then you can spend more time on writing or get one which is ready made from Torry or somewhere else.
HTH.
IMHO, you can use frames for each analysis result page, then you can use either PageControl or TabSet or any other visual control for loading and showing the appropriate frame.
Since frames are totally independent from the visual control you use to select proper period and analysis, you won't be restricted to tab-based controls; for example you can have a tabset for analysis selection, and a treeview for period selection.
Frames have some additional benefits here too:
First of all, their code is kept in
separate units and this will increase
code readability.
Second, you can design a base frame
and put all the controls and codes
which all these 4 analysis share into
that base frame, and in this way have
a better code reuse.
Third, you can either drop each frame
on your main form and make them load
just like before, or you can define a
container control (e.g a panel), and
based on user's selection load one of
the frames into the container control
dynamically, so reduce initial load
time of your application, and
probably reduce the overall system
resource consumption.

Delphi control that could mimic "Add-ons|Extension list" of Firefox?

My aim is to update the look of the GUI in my app. Currently my GUI contains a lot of listboxes which are used to edit some objects in an old fashioned way, that is, user double-clicks an item and a dialog is shown to modify the corresponding object.
I think a good modern approach is how Firefox displays the extensions installed (a snapshot below).
My question is about how to build such a GUI in Delphi(win32) easily? Are there any components you use mimicing such behaviour or will I just need to code this from stratch using panels? (IMO a very cumbersome job I'd like to avoid - the selection logic, resizings, etc...)
You can do something similar (not exactly) with standard components; TDBCtrlGrid, TSpeedButton,...
alt text http://img8.imageshack.us/img8/9585/imagen29ox3.png
If you're using Delphi 2007 or Delphi 2009, you might be able to do something similar using TCategoryButtons (from the 'Additional' component palette page). Drop it on a form and right click to display the popup menu, and then click "Categories Editor...". Add a category with the resulting dialog, set it's caption, and optionally set up Items it contains. Not exactly the same, but it might do what you need.
You could also use a dialog with a TTreeView (if you have categories of objects) or TListView to emulate the Delphi 2007 Projects->Options dialog. Clicking an item in the TreeView or ListView displays the proper page of a TPageControl to configure the object.
I mostly agree with Lars, but I would use a frame for each item instead of a panel. That would separate into its own file, and you would get easy designtime support for it.
Using a TFrame for each list item and put them all Aligned Top on a TScrollBox might work. Also see TDBCtrlGrid which does something like that in combination with datasets.
It can be done with existing Delphi controls.
For instance in the TCustomListBox control you can create your own OnDrawItem event to draw your own list item. You also need to create your own OnMeasureItem to change the item height.
In some cases it is very limited, so if you want more freedom you will need to do it from scratch.

Resources