Forum Replies Created
-
AuthorPosts
-
IPStevenParticipant
Hamilton
Thanks for pointing out that the TsAlphaHints component has it's own OnShowHint method.
I was calling my on function by doing:
Application.OnShowHint := MyShowHint;
I used my function MyShowHint() to manually control the wrapping of my hint text.
I moved my code into the HintManger.ShowHint() and the default position of the hint window changed! Its actually usable.
I tried again to offset the hint window's X position – and it wasn't working.
In tracing out the code I found that is TsHintManager.OnShowHintApp is being called after ShowHint()
Code:procedure TsHintManager.OnShowHintApp(var HintStr: string; var CanShow: Boolean; var HintInfo: THintInfo);
begin
FHintPos := HintInfo.HintPos;
if Assigned(FOnShowHint) then FOnShowHint(HintStr, CanShow, HintInfo, HintFrame) else inherited;
if (FHintPos.x HintInfo.HintPos.x) and (FHintPos.y HintInfo.HintPos.y) then FHintPos := HintInfo.HintPos else begin
end;
end;the code shows that unless I change both the X & Y coordinates that the changes are discarded!
Testing verified that the HintPos can be changed as long as I change both X & Y coordinates by at least +/- 1.
Thanks for your help in unraveling this, much appreciated.
IPStevenParticipantHamilton,
Thanks for the reply.
That works if you're not using the AlphaSkins HintManager.
When using the AlphaSkins HintManager
TsCustomHintWindow.ActivateHintwhich is called after the OnShowHint event appears to ignore the HintPos position information entirely and calculate its own coordinates.
I'm hoping there is a way to do this (create the offsets) that doesn't involve hacking the AlphaSkins code because that creates maintenance issues later on.
IPStevenParticipantLooks like v7.57 fixed my ComboBox issues and the border of the dropdown box is no longer white (the issue that Oconell mentioned).
Thank you! :a3:
Have a Happy Holiday (Merry Christmas, Happy Hanukah, etc.)! :a4:
IPStevenParticipantReplacing the sComboBox.pas file with the one from version 7.55 seems to have fixed my combobox issues. My app supports unicode and the comboboxes are all pretty much the default size.
Unfortunately I haven't had more time to delve deeper into this because I've got a major project that I need to deliver by tomorrow morning.
Re: In addition, if you are using dark skin, than border of drop down list is still white.
Is this a new issue or continuing? I didn't notice with the dark skins that I checked, mainly WMP11 & WMP 2008, but maybe I missed it.
IPStevenParticipantAll of my ComboBoxes are embedded in panels, some of the panels are on PageControls.
I been experimenting with one ComboBox in my main form.
If I replace the ComboBox or add a new one at the same location (in the same PageControl/in the same panel) I have the same problem.
If move the ComboBox off the TsPanel directly to the form – it works/stays visible at runtime.
As I mentioned previously, I have tried to create an app to demonstrate this issue but haven't been able to reproduce it.
Edit:
If I copy all the form objects and paste them into a new project the ComboBoxes stay visible.
IPStevenParticipantYes, I rebuilt the project and I rebuilt/reinstalled the AlphaControls package – actually rebuilt both several times.
But thank you for your suggestion.
…Steven
IPStevenParticipantThe problem is fixed in the test file.
Looks nice, thanks.
IPStevenParticipantTsSpeedbuttons with skin section SPEEDBUTTON_SMALL still broken in “v7.50 stable” when the they are placed on a panel. Check demo app previously uploaded.
IPStevenParticipantI just realized that the NeonNight speedbutton issue is occurring when the controls are placed on a TsPanel.
The TsLabel component looks like it has the same issue.
I've updated the demo to illustrate.
…Steven
IPStevenParticipantSerge,
Regarding the TListBox issue.
I tried creating a demo of the TListBox/NeonNight issue I ran into but could not reproduce the problem,
there must be something in this particular project that is causing the issue.
My apologies about the misdirection.
The speedbutton issue I could reproduce and I have attached a demo project.
[attachment=5114:AC_NeonNight prob.zip]
…Steven
IPStevenParticipantAlphaControls 2010 v7.48
Delphi 2010, Windows7 with Aero on
The TsListBox black text on black background only happens if the style is lbStandard, lbVirtual or lbVirtualOwnerDraw. lbOwnerDrawFixed and lbOwnerDrawVariable are both OK. I never use lbVirtual or lbVirtualOwnerDraw but just switching the style to these shows the same issue.
The SkinSection is set to EDIT.
The TsListBox is placed on a TsPanel on the form.
IPStevenParticipantAnother issue with NeonNight
TsListBox – when style is lbStandard you get black text on black background.
IPStevenParticipantappears to be fixed in 7.47 beta
🙂
IPStevenParticipantAlphaControls beta v7.46
Delphi 2007 Window 7 64bit, Aero on
On some skins the truncation is pronounced
[attachment=4995:LabelFX_issue_Desert_skin.png]
[attachment=4996:LabelFX_issue_Elegant_skin.png]
[attachment=4997:LabelFX_issue_BlueGlass_skin.png]
on others no noticeable truncation occurs unless the BlurCount property is set low.
[attachment=4998:LabelFX_issue_XPLuna_skin.png]
[attachment=4999:LabelFX_issue_Gold_skin.png]
Shouldn't BlurCount only affect the Shadow?
Here is the sample project used to create the above images:
[attachment=4994:AC LabelFX bug.rar]
IPStevenParticipantTest in v7.46 beta…
Still have the same problem – but only in the skin Desert.
11 of the other skins that I checked out were all fine:
DarkGlass
Deep
Golden
Mac Metal
Office12Style
Sand
Sapphire
Vienna Ext
Winter2003
WMP 2008
WMP11
IPStevenParticipantFixed in v7.46 beta, thanks.
IPStevenParticipantHi Serge,
Were you able to reproduce the problem?
…Steven
IPStevenParticipantYou need to use the DrawItem event.
In the code below I'm using a list box to contain names of the fonts I want and the code cycles through the list.
Code:procedure TForm1.sCheckListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var
i : Integer;
begin
i := Index;
if Index >= (sListBox1.Count – 1) then
i := Index mod sListBox1.Count;with sCheckListBox1.Canvas do
begin
FillRect(Rect);
Font.Name := sListBox1.Items;
Font.Size := 0; // use font's preferred size
TextOut(Rect.Left+1, Rect.Top+1, sCheckListBox1.Items[index]);//if you don't know what to set the itemheight as
//since MeasureItem() property doesn't work – you can use this, its ugly but does the job
i := TextHeight('Wgyj') + 2; // measure ascenders and descenders
if sCheckListBox1.ItemHeight < i then
sCheckListBox1.ItemHeight := i;
end;
end;I haven't messed with changing the font properties (Bold, Italic, etc.) and don't know if its as simple as adding
Code:Font.Style := [fsBold];or not.
I don't know if it is bug in AlphaSkins or not but the MeasureItem() event in sCheckListBox is not firing.
With a regular list box you could use this event to individually adjust the height of each line as needed.
Serge – if your checking out this thread maybe you could comment or check it out?
**Edit – added attachment and image**
I've attached a sample project demo below.
[attachment=4970:CheckListBoxDynamicFonts.png]
[attachment=4969:CheckListBoxDynamicFonts.rar]
BTW if you want to change the background colors in the CheckListBox check out:
http://delphi.about.com/cs/adptips2002/a/bltip0602_4.htm
…Steven
IPStevenParticipantI came up with my own fix and it appears to work fine (code below) at least using AlphaControl reg v7.31 Stable, Delphi 2010 and Windows7 x64.
Regarding your comments…
Not sure how this applies to localization issues, but would suspect that it is handled same way as regular Delphi message box routines.
Quote:sMessageDlgPos is keeped for compatibility with old code.I would politely disagree since sMessageDlgPos() worked in AlphaControls v4.79 and is functionally broken in v7.31.
It doesn't produce an error or crash so it is compatible in that fashion, but the behavior has changed.
The message box caption is retained in the current version, but the positioning ability is lost.
My workaround retains both features and uses the most common default settings.
//Uses Dialogs
Code:function SMessageDlgPosFix(const DlgFrmCaption : string; const Msg: string;
DlgType: TMsgDlgType=mtInformation; Buttons: TMsgDlgButtons=[mbOK];
HelpCtx: Longint=0; X: Integer=-1; Y: Integer=-1; DefButton: TMsgDlgBtn=mbOK ): Integer;
var
mf: TForm;
begin
mf := CreateMessageDialog(Msg, DlgType, Buttons, DefButton);
try
mf.Caption := DlgFrmCaption;
mf.HelpContext := HelpCtx;
mf.HelpFile := '';if X >= 0 then
mf.Left := X
else
mf.Left := (Screen.Width div 2) – (mf.width div 2);if Y >= 0 then
mf.Top := Y
else
mf.Top := (Screen.Height div 2) – (mf.height div 2);Result := mf.ShowModal;
finally
FreeAndNil(mf);
end;
exit;
end;IPStevenParticipantQuote:I can add additional code for positioning of messagebox, but this code will not work without skins (in standard mode)…I think I misunderstood you.
If you can't make sMessageDlgPos() a skinned version of MessageDlgPos() then there is no point in having sMessageDlgPos(). I could simply call MessageDlgPos() myself and avoid the confusion.
The application that I am upgrading uses AlphaControls v4.79.
With that version I created my own function SBMessageDlg() (code below) which is skinable version of MessageDlgPos().
With SBMessageDlg() – I resolved 3 issues I had:
1) Fixed problem with messages not being skinned in XP running with Classic theme
2) Ability to vertically offset message for better visibility and to prevent it from appearing under status forms.
3) Fixed problem I had where if an error occurred while the program was loading, i.e. when the Splash screen was showing, that the message would appear under the splash screen effectively locking up the program.
Unfortunately now that I'm trying to upgrade this application to the current version of AlphaControls (v7.29 from v4.79) this function no longer works. This is not a great surprise since a lot has changed in AlphaControls since v4.79 (which is good).
If I recall correctly TsMessageForm() doesn't exist in the current version of AlphaControls.
Code://written for use w/ AlphaControls v4.79.
function SBMessageDlg(const Msg: string; DlgFrmCaption : string='';
DlgType: TMsgDlgType=mtWarning; Buttons: TMsgDlgButtons=[mbOK];
HelpCtx: Longint=0; Voffset : integer=0; DefButton: Integer=1 ): Integer;
var
X, Y: Integer;
mf: TsMessageForm;
i : integer;
btn: TButton;begin
//2.20.07 fixes grey background when using XP Windows Classic
//9.11.09 fix for msgbox appearing under Splash form and hanging program
X := -1;
Y := -1;
mf := TsMessageForm(sCreateMessageDialog(DlgFrmCaption, Msg, DlgType, Buttons));try
mf.HelpContext := HelpCtx;
mf.HelpFile := '';
if X >= 0 then mf.Left := X;
if Y >= 0 then mf.Top := Y;
if (Y < 0) and (X < 0) then begin
mf.Left := (Screen.Width div 2) – (mf.width div 2);
mf.Top := (Screen.Height div 2) – (mf.height div 2);
end;
if Voffset <> 0 then
mf.Top := mf.Top + Voffset;with mf do
For i := 0 To ComponentCount-1 Do
If Components Is TButton Then Begin
btn := TButton(Components);
btn.Default:= btn.ModalResult = DefButton;If btn.Default Then //if no match the ActiveControl is not changed!
ActiveControl := Btn;
End;//Check to see if Splash form is showing!
//if so prevent messagebox from opening under Splash
////////////////////////v1.4.1.2 091109
if frmSplash <> nil then
if frmSplash.Visible then
frmSplash.FormStyle := fsNormal;Application.ProcessMessages;
FormOnTop(mf.Handle);
Result := mf.ShowModal;if frmSplash <> nil then
if frmSplash.Visible then
frmSplash.FormStyle := fsStayOnTop;Application.ProcessMessages;
////////////////////////
finally
FreeAndNil(mf);
end;
exit;end;
-
AuthorPosts