@@ -43,6 +43,7 @@ CAddressBand::CAddressBand()
43
43
fGoButton = NULL ;
44
44
fComboBox = NULL ;
45
45
fGoButtonShown = false ;
46
+ fAdjustNeeded = 0 ;
46
47
}
47
48
48
49
CAddressBand::~CAddressBand ()
@@ -66,7 +67,10 @@ HRESULT STDMETHODCALLTYPE CAddressBand::GetBandInfo(DWORD dwBandID, DWORD dwView
66
67
{
67
68
if (pdbi->dwMask & DBIM_MINSIZE)
68
69
{
69
- pdbi->ptMinSize .x = 100 ;
70
+ if (fGoButtonShown )
71
+ pdbi->ptMinSize .x = 100 ;
72
+ else
73
+ pdbi->ptMinSize .x = 150 ;
70
74
pdbi->ptMinSize .y = 22 ;
71
75
}
72
76
if (pdbi->dwMask & DBIM_MAXSIZE)
@@ -81,7 +85,10 @@ HRESULT STDMETHODCALLTYPE CAddressBand::GetBandInfo(DWORD dwBandID, DWORD dwView
81
85
}
82
86
if (pdbi->dwMask & DBIM_ACTUAL)
83
87
{
84
- pdbi->ptActual .x = 100 ;
88
+ if (fGoButtonShown )
89
+ pdbi->ptActual .x = 100 ;
90
+ else
91
+ pdbi->ptActual .x = 150 ;
85
92
pdbi->ptActual .y = 22 ;
86
93
}
87
94
if (pdbi->dwMask & DBIM_TITLE)
@@ -451,6 +458,8 @@ LRESULT CAddressBand::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHan
451
458
long newHeight;
452
459
long newWidth;
453
460
461
+ fAdjustNeeded = 1 ;
462
+
454
463
if (fGoButtonShown == false )
455
464
{
456
465
bHandled = FALSE ;
@@ -505,6 +514,24 @@ LRESULT CAddressBand::OnWindowPosChanging(UINT uMsg, WPARAM wParam, LPARAM lPara
505
514
positionInfoCopy = *reinterpret_cast <WINDOWPOS *>(lParam);
506
515
newHeight = positionInfoCopy.cy ;
507
516
newWidth = positionInfoCopy.cx ;
517
+
518
+ /*
519
+ Sometimes when we get here newWidth = 100 which comes from GetBandInfo and is less than the 200 that we need.
520
+ We need room for the "Address" text (50 pixels), the "GoButton" (50 pixels), the left and right borders (30 pixels)
521
+ the icon (20 pixels) and the ComboBox (50 pixels) for handling the text of the current directory. This is 200 pixels.
522
+ When newWidth = 100 the Addressband ComboBox will only have a single character because it becomes 2 pixels wide.
523
+ The hack below readjusts the width to the minimum required to allow seeing the whole text and prints out a debug message.
524
+ */
525
+
526
+ if ((newWidth < 200 ) && (newWidth != 0 ))
527
+ {
528
+ if (fAdjustNeeded == 1 )
529
+ {
530
+ ERR (" CORE-13003 HACK: Addressband ComboBox width readjusted from %ld to 200.\n " , newWidth);
531
+ newWidth = 200 ;
532
+ fAdjustNeeded = 0 ;
533
+ }
534
+ }
508
535
SendMessage (fGoButton , TB_GETITEMRECT, 0 , reinterpret_cast <LPARAM>(&buttonBounds));
509
536
510
537
buttonWidth = buttonBounds.right - buttonBounds.left ;
0 commit comments