I have a question regarding to two forms snapping each other.
For example if I move one form close to another and it's in certain distance then it's edge snaps to another forms edge. After snapping, I can move two forms by moving only one form. How can I achieve this?
I have seen this effect in Skype, DVD Decrypter and in ImgBurn.
Try using the TJvFormMagnet component of the JVCL (JEDI Visual Component Library).
I was using dynamically created forms and JvFormMagnet didn't seem to work for me. You can try the TMagnet Pas file component for snapping of forms to one another. A great alternative to docking. Get it Here with demo and compiled example. Its really very simple.
Related
On some programs there is an interesting possibility:
in case the work area is very large, there is the overall picture, which provided by the plan of all component.
Which component allows you to add this capability to my program?
I would like to implement this, at least for StringGrid and TChart.
To do this in a generic way, you have to do off-screen painting.
That is a lot of work, especially getting the details right.
JED Software once write something similar to show previews of forms in the IDE called Visual Forms and it took them a long time.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Replacing a component class in delphi
Does anyone have any tips for modifying the VCL components and making them so they are relatively default within the IDE? This means not necessarily descending from them, but changing functionality in places that don't seem to allow such things in a descendant object. And if they can be used in place of the standard components, that's a bonus as well.
For example, one of the things I'd like to do is an alpha blended mouseover on a TButton. I notice no OwnerDraw event and the code to modify how the button was drawn seems to not be in a place that I can override. Any suggestions, or would I have to strip TButton and all its ancestors out of the VCL code and modify it directly?
You can choose one of the following methods:
Override ReadState of your form, as explained here
Use an interposer class, as explained here and here
Assign a new WindowProc, as explained here.
You are making several questions related to developing custom V.C.L. controls.
Since, its a very extended topic, you may want to browse or search the internet about it.
As a fast question, there are several ways to develop or extend a control.
Sometimes, the same control can be developed in different ways,
other, it depends the kind of control, that you want to develop.
You also mention how to make a control, interact with the Delphi I.D.E.
Delphi controls work with packages, you can make a package with plain libraries without controls, you may want to start doing that, before making a control.
You can make a control, that doesn't interact at all, and only works by running the application, and later add interaction with the Delphi I.D.E.
In Delphi, when you develop a control and want to put it on form, while designing, internally, its like Delphi was your application, and already have your control.
If you want to change the appearance of all TButtons in your application, you can do it without modifying the VCL at all. I see no necessity to modify or even subclass a VCL control yourself, when a few hundred button components exist out there. For example, for alpha-blended mouseovers, just check out the TMS controls.
However, for do-it-yourself techniques; Method one (recommended as simple) is to simply take all the TButtons out of your application and replace it with something else. VCL component replacement (globally) is easily done via gExperts. To see how to combine a standard control appearance (how a button looks) with some overlaid elements drawn in Delphi code, see TBitBtn as a sample. Rather than subclassing TButton or TCustomButton, I recommend you examine TBitBtn sources, and start from it.
Method two (not recommended as simple) is to start using a skinning system which can draw a completely different appearance over standard controls.
I need a way to have a label (or something like it) print sideways. I would really like it to work at design time if at all possible.
Is there any controls / mechanisms that anyone knows of to do this? (Not .net controls please)
You would probably get better results by searching the Delphi ThirdPartyTools forum archives using CodeNewsFast ( http://www.codenewsfast.com ) full text search, or by posting question on that forum directly.
Here's one label control that does rotated text, I think many controls are enabled to do this now, in one way or another:
http://cc.embarcadero.com/Item.aspx?id=18645
Here's link to another freeware label component, from a guy that's always provided good quality stuff:
http://www.scalabium.com/anglelbl.htm
I haven't used Delphi in a few years and I don't remember exactly, but I think many of the third party component sets (e.g., DevEx, TMS) had rotation as one of the properties for labels on their edit controls back even five or more years ago.
Here's link with info on nitty gritty details on how to roll-your-own rotated text:
http://delphi.about.com/cs/adptips2003/a/bltip0703.htm
I wondered if you have a work around for the problems with docking forms in Vista, such as the close button being partially obscured, and the gray border when being dragged rendering extremely slow, making a appearing / disappearing appearance?
Delphi 2007 & Vista (64 bit)
I believe you have two different bugs here.
The obscured button thing is new to me. Don't think I've seen that one.
The second bug (resizing) is a known one, ie it was fixed in D2009, but there is a solution.
I found it in a JEDI VCL bug fix report and when I it applied to my code it worked great.
JEDI Issue Tracker Report
The fix can be non trivial for users of the native Delphi VCL docking system. If you're using a third-party docking system such as JvDock from the JEDI VCL it already has it supported. I implemented it in one of my major applications but I'm using a mixture of native VCL docking and third-party components.
I wanted to post you the solution I have but I got looking into my code and it spans a bunch of units and parts of the main code tree.
There is no simple answer except maybe you want to look at the JEDI docking system.
There is also another known bug with DockingTabs under vista, in that the obscured areas of a "docked" window when they slide closed doesn't repaint properly. Slide out works fine, slide in (hide) doesn't there is a solution to this one as well, but it requires modifying VCL source to make it work.
Sorry,
Ryan
Update: I've looked into the JVCL implementation of the docking, and I think it will work quite nicely, as it doesn't have either of the problems. Thanks again for your help.
I wonder how difficult it would be to be able to have a custom background or be able to draw on the datamodule canvas somehow so that the relationships of all the datasets can be nicely represented with arrows and stuff. Way back in Delphi 7 or so I seem to remember some sort of datamodule designer which has disappeared (I always found it annoying anyway).
Does anyone know if this is possible through some sort of IDE plugin or something?
TDataModule is a direct descendant of TComponent, and as such, it doens't have a Canvas or any such painting provisioned in it. As is, there is no way to draw or paint on it.
It is conceivable that you could create a descendent that has a TCanvas, but you'd have to really hack into the IDE to get it to be drawn on at design-time. It is an interesting idea, however.
There used to be a "Diagram" tab on the designer for Datamodules. It did have the ability to put notes, boxes with text, and data relations. It was not very understood or used, and the feature was dropped, I guess. (Before my time at CodeGear...)
Or, you may change the datamodule to a form. Leave it visible during development, for testing, documentation and debugging; and turn it it invisible for production. On the form you may put a visio viewer component and some datagrids, accessed thru a tab rack, for quick browsing of the data.
I believe that some way to organize the components in visible groups on
screen could be nice... I have a report DM which have tons of datasets,
dataset providers and Rave DataSources (circa 40 components)....
If I could create some groups to differentiate which is used in
what report.
But this in DM designer itself, not on a separate drawing space...