Hightlight certain days in TMonthCalendar component - c++builder

I am working with a TMonthCalendar VCL component in C++Builder and I am wanting to highlight certain days in a month changing its color font or its forecolor.
I have seen this properties exists in the component but the changes are applied to all days and I need to apply only to a few days. In the other hand, I tried using bolddays function but days are not highlighted enough...
How to highlight specific days in this component?

Sorry, but the standard OS MonthCalendar control that TMonthCalendar wraps simply does not support custom fonts or colors. Using the OnGetMonthInfo and OnGetMonthBoldInfo events, and the BoldDays() method, all you can do is specify whether individual days are displayed as bold or not. If that does not suit your need, then you will have to create your own custom MonthCalendar control from scratch, or find a third-party implementation.

Related

How do I add labels to tcalendarview in delphi

I have been looking for a calendar component that will allow me to add text/labels to the day cells, but haven't been able to do so yet.
In lieu of that, I am trying to update a custom calendar component. this component was developed using the code from vcl.samples.calendar (so, like, windows 16), and is grid based.
I want to update it to using a current calendar (vcl.winXCalendars).
It's required that it takes and displays a series of text labels (exactly 4), with fonts, color, visible/not visible and right aligned text, in the day cells.
The original code cloned the vcl.samples.calendar (instead of inheriting), then used the draw events to show the values for the day from an element array of the values. The values, in this case, is a number of hours worked for the day, broken into 3 classifications and a total (no start/end times, which is why a scheduler wouldn't work).
I am having a bit of an issue tracking down 'where' to put this code in place in a calendar inherited from tCalendar view. (note: NOT a component writer, though I seem to be dabbling in it more and more these days)
Anyone have any idea how to do this? Or know of a calendar component that will allow it?

Can I enlarge the menu font size in Delphi 2?

Everything I've found says I can't do this with Delphi 2's TMainMenu but if somebody here has managed it somehow, I'd really like to know the trick. I found code that changes the System menu font size but none that confines the change to only the application. Anyone here know how to do this or do I have to just accept Delphi 2's tiny menu font size that appears on today's large screen monitors? (Moving the app to an upgraded Delphi is not the answer I need ;-)
The only way to achieve per application custom menu fonts is with an owner drawn menu. Delphi 2 does not support owner drawn menu items directly in the VCL properties of a TMainMenu component. This support was introduced only in Delphi 4.
You could still implement an owner drawn menu, but it would involve implementing them using standard Windows API techniques, and handling the required messages on the forms which own the menus involved. It is not especially difficult but not as straightforward as the event based implementation available in Delphi 4 and later.
You can still use a TMainMenu to define your menus but in your application you would then need to programmatically set the owner draw flag on the menu items and handle the resulting messages appropriately. Doing this, you will need to handle all aspects of drawing the menu - you cannot simply set/change the font and leave the system to draw the menu items. You may also need to provide additional handling for any keyboard shortcuts you have set up.
If this is a viable approach then information on implementing owner drawn menus at the API level can be found here.

Delphi TListBox iOS making new itemstyle/behavior

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.

Create a Ribbon Control in Delphi with Combobox as one of the control?

I am a newbie to using Delphi 2010 to write Ribbon Control...
I wanted a comboBox control with 5 to 6 lines for user to choose from on my ribbon...
I've set the CommandStyle of the TActionClient to csCombobox and I had a hard time figuring out how to set the content of my comboxbox and also the control seem to be disabled once I set the CommandStyle from csButton to csCombobox.
Please help.
I've never used the Ribbon before, but i made a little test and this is wath i get, I don't know if this is wath you want:
alt text http://img2.imageshack.us/img2/6885/ribboncombo.png
Just add strings to the Items property

TMonthCalendar of delphi - disable the buttons

Is it possible to disable the buttons that change the date on the TMonthCalendar (VCL native)?
The calendar control is not a native Delphi control, but a wrapped Windows standard control. As such it can only be accessed using the documented interface.
In particular Spy++ reveals that it is a single window, so calling EnableWindow() to disable the navigation buttons seems impossible. What you could do is set the MaxDate and MinDate properties of the VCL control to the first and last day of the interesting month, so the month can't be changed. Unfortunately this will result in an annoying sound when the buttons are clicked.

Resources