Forum Replies Created
-
AuthorPosts
-
TAZParticipant
I have a workaround for this. I set the main form border style to none before the dialog execute. Then after the dialog execute (both open and cancel) set the main form border style back to its original position. Surprising thing is that when the border style is set to none, the main form disabled appearance does not change (title bar is still there). So this operation appears to be seamless and that is all I can ask.
Thanks.
'Support' wrote:Hello
I see this flashing and I'll try to improve it soon if possible.
TAZParticipantOne more change to the procedure if the item width is greater than the combo box width. Have to account for the possible vertical scrollbar which was in the wrong place.
I also include changes in the dropdown width if images are included. Interesting adventure.
Code:procedure ComboBoxEx_AutoWidth(const theComboBox: TsComboBoxEx);
const
HORIZONTAL_PADDING = 4;
var
itemsFullWidth, idx, itemWidth: integer;
c: TBitmap;
begin
c := TBitmap.Create;
try
itemsFullWidth := 0;
c.Canvas.Font.Assign(theComboBox.Font);
for idx := 0 to Pred(theComboBox.Items.Count) do
begin
itemWidth := c.Canvas.TextWidth(theComboBox.Items[idx]);
Inc(itemWidth, (2 * HORIZONTAL_PADDING));
if (itemWidth > itemsFullWidth) then
itemsFullWidth := itemWidth;
end;
if (theComboBox.DropDownCount < theComboBox.Items.Count) then
itemsFullWidth := (itemsFullWidth + GetSystemMetrics(SM_CXVSCROLL));
if (theComboBox.Images nil) then
itemsFullWidth := (itemsFullWidth + theComboBox.Images.Height);
if (itemsFullWidth > theComboBox.Width) then
begin
itemsFullWidth := (itemsFullWidth + (2 * HORIZONTAL_PADDING));
SendMessage(theComboBox.Handle, CB_SETDROPPEDWIDTH, itemsFullWidth, 0);
end;
finally
c.Free;
end;
end;'TAZ' wrote:I figured it out and I am not sure why I had to do this. The original problem was that setting the dropdown width was fine when the font size was 8. However, I have the font size set to 12. The dropdown width did not adjust. That was puzzling.
In my research I came across using a TBitmap to set the text length. It worked.
I am not sure why I had to assign the combo box font to the bitmap and then use the bitmap textwidth to get the proper dropdown width. Very odd.
https://stackoverflo…-without-canvas
See attached.
Thanks.
TAZParticipantI figured it out and I am not sure why I had to do this. The original problem was that setting the dropdown width was fine when the font size was 8. However, I have the font size set to 12. The dropdown width did not adjust. That was puzzling.
In my research I came across using a TBitmap to set the text length. It worked.
I am not sure why I had to assign the combo box font to the bitmap and then use the bitmap textwidth to get the proper dropdown width. Very odd.
https://stackoverflo…-without-canvas
See attached.
Thanks.
'TAZ' wrote:Well, I feel silly. I will get back to you.
TAZParticipantWell, I feel silly. I will get back to you.
'Support' wrote:Thank you for the demo.
Positions of controls are correct there?
Look what I see on my side.
TAZParticipantDelphi version is Tokyo 10.2.3
I have attached a project that demonstrates the problem. This is based on https://www.thoughtc…n-width-1058301
Simple and Auto for regular sComboBox works. Does not work for sComboBoxEx.
I also included the last example in the article. It does not work for either.
So, how are you able to get it to work for sComboBoxEx?
Thanks.
'Support' wrote:Which version of the Delphi do you uses?
I have tried the CB_SETDROPPEDWIDTH message with TsComboBoxEx component, it works well in my test.
TAZParticipantFixed. Thanks.
'Support' wrote:Thank you for the demo, this error will be fixed in the v14.19 at the nearest days.
TAZParticipantI have attached my exe. Did not change any code.
TAZParticipantFor curiosity sake, I downloaded the project. I then ran JM's compiled exe and verified that the second window background is missing. You have to move the mouse over for it to show.
I then loaded the project into my Delphi IDE and compiled it. Then ran the exe from (1) the IDE and (2) as a stand alone and the problem did NOT occur. The second window background appeared when called.
Not sure if this helps.
Windows 7 Ultimate, Delphi 10.2.3, AC 14.18
TAZParticipantGood to know. Thanks.
'Support' wrote:Hello
It's Ok, something happened with date on the server. It's fixed now.
TAZParticipantThank you for the new demo.
TAZParticipantFixed. Thanks.
'Support' wrote:The XPLuna skin will be updated in the v14.05
TAZParticipantExcellent. It works. Thanks.
'Support' wrote:I will improve it in the nearest release.
TAZParticipantAll fixed except XPLuna. The selected “Arrows style” is still being cut off on the left side.
'Support' wrote:The issue will be solved in the nearest release.
TAZParticipantFixed. Thanks.
'Support' wrote:The skin will be updated in the nearest release.
TAZParticipantFixed. Thanks.
'Support' wrote:These skins will be updated in the nearest release.
TAZParticipantOkay. I see what you are doing. I had to dig deeper and saw that animation was controlling this effect. Thanks.
'Support' wrote:Hello!
Do you uses the SetPPIAnimated(NewPPI: integer) procedure?
NewPPI parameter should not be equal to DefaultManager.Options.PixelsPerInch property.
TAZParticipantI adjusted my code. It was working in v13 so you must have corrected something that exposed this. Thanks.
'Support' wrote:Hello
AlphaSkins is active when this code is executed?
Skin should be activated already, please check it.
TAZParticipantSo far no repeat. Just close this topic.
'Support' wrote:Hello
So, this issue is not repeated anymore?
TAZParticipantIt momentarily shows then disappears. I went back and looked very old code that had been in place for a long time and removed it as it seemed unnecessary anymore. I then did a movie of for about 100 minutes and used a looping program to start and stop my main program which produced almost 300 start/stop occurrences. I used Custom BG 3 skin. I looked at the video and did not produce any problem occurrences. Still not satisfied. I am planning on producing an 8 hour video. If there are no occurrences then the code removal did the job. That code has been in there so long that I forgot why I did it (unfortunately I did not make a comment). It was in the dpr source just before Application.Run. Never had problems with that code before but within the past month or so was when this disappearance started occurring.
'Support' wrote:This window is just not visible? Or, maybe, it's placed at the background and covered by other windows?
TAZParticipantThanks. I usually do not place popup menu on an individual component, but this was a specific.
Safe the search since this appears to be by design.
'Support' wrote:The TsSkinSelector component has been derived from standard TComboBoxEx component, where right mouse click with popupmenu doesn't work (if Style is csExDropDownList).
Only DblRightMouseClick works.
I will search a solution, but I'm not sure that solution exists.
-
AuthorPosts