I have been making components for Delphi for a couple months now. Currently I am extending the TButton to create another form that has 20 or so components on it. I have done this recently and just created everything dynamically in click event. Is there a way to create to form and have it compiled into the component so I can use the IDE to design the form?
Thank you
Yes. Simply add your TForm unit to your button's Package, and then you can design it like any other project.
Related
I am working on a label printing project and I am using FastReports and also a TJvWizard from the JEDI Components Library.
I embedded the report's designer on a TpageControl and I added buttons and other components to the form so that I can interact from Delphi to the report's designer and add components to the report or modify their properties.
the problem I am having is that I need to know when the user selects (Clicks) a component in the report so that I show the correct properties for the component type that was selected. and I already asked on the fastreport support but there is no such event or any way the report notifies when it happens.
so, my question, is there any way to set a general on click event or something similar that lets my form know that the mouse was clicked, no matter where or what the user clicked but to be notified about the action itself of clicking.
I already tried setting the OnMouseDown event for the TTabSheet where the report's designer is embedded but It doesn’t trigger anything.
if it helps, I have my form and the TJvWizard in it, the wizard has some JvWizardIneriorPage and in one of those is my TPageControl which has two TTabSheet and I embedded the designer in one of those.
Edit:
in This other question provided by Sertac in the comments I found what I needed.
Recently I've been doing some research in to VCL Styling (Embarcadero XE2 for Delphi).
I can load and set the styles so that works fine.
Currently I'm exploring the VCL Style Designer and what I try to figure out is how can I move the minimize, maximize, resize, close and help button to the left instead of the current default right while the application text (caption of the form) is on the right.
I am at my whits end and hope some one can give me some pointers.
So basically what I try to 'emulate' is the Mac look on a Windows form.
Any help is welcome.
What do you want accomplish is not related to the VCL Style Designer, instead you must create a custom form style hook.
Follow these steps.
Create (and register) a new form style hook descending from the TFormStyleHook class.
Override the PaintNC method to draw the title buttons in the new positions.
Handle the WM_NCMOUSEMOVE, WM_NCLBUTTONDOWN and WM_WM_NCLBUTTONUP messages to detect the status of the title buttons (hot, pressed) and fire the actions (close, restore, maximize, minimize).
I'm building a design component derived from TFrame with a TPanel and a TdxLayoutControl on it. By registering the Frame as a component using Jeroen Pluimers' RegisterFramesAsComponents method (http://wiert.me/2009/07/16/delphi-frames-as-visual-components-dont-forget-your-sprig/) I was able to get to the desired result.
I would now however like to open the LayoutControl's designer at design time.
I already made a published property for the LayoutControl but I can not seem to find a way to open its designer.
Any help would be greatly appreciated.
I need to show custom data. For example I need to show a contact list with name, description, photo. And ideally I would also like to show custom data there, e.g. a button to launch telephone call. The default styles do not quite do what I want, but fairly close.
Thus, as far as I can tell, TListBox could be a decent control for this if I could create custom styles? Is that possible? (Anotther problem of course is setting the values of the custom data controls.)
You should take a good look at the FMX CustomListBox example AFAIK even the example alone already seems to have exactly what you need, already set in place.
It took me about 10 minutes to produce this result straight out of the CustomListBox example with your description:
One thing that the included FMX example demonstrates perfectly is how easy it is to add any FMX control to the ListBox via the TStyleBook Layouts such as buttons, images etc... basically any visual control upon which you then implement the HitTest, again, all very detailed in the FMX Delphi example.
I'm using Delphi 6 (actualy BCB6 but nobody uses that, so Delphi advice is fine). Some controls let you create a custom class of items they can contain, like TListView. Does TRadioGroup have a way to do this without recreating most of the functionality from scratch? I have my own custom TRadioButton derived controls I created that have a custom look, and I'd like all of my radio buttons to match.
I'm not seeing anything possible looking at the source code in extctrls.pas, and not finding anything online, but figured I'd ask because it is late and I might have overlooked something.
TRadioGroup has no such functionality. What you can do is use a TGroupBox to contain your special controls.