зеркало из https://github.com/mozilla/pjs.git
Make scrollbars work again in custom and additional windows (nsbeta3+ b=49856; r=dbragg).
This commit is contained in:
Родитель
817f0a5a79
Коммит
62180e1715
|
@ -128,7 +128,7 @@ ShowAdditionsWin(void)
|
|||
HUnlock(gControls->cfg->selCompMsg);
|
||||
SetRect(&listBoxFrame, gControls->aw->compListBox.left,
|
||||
--gControls->aw->compListBox.top,
|
||||
gControls->aw->compListBox.right += kScrollBarWidth,
|
||||
gControls->aw->compListBox.right + kScrollBarWidth,
|
||||
++gControls->aw->compListBox.bottom);
|
||||
FrameRect(&listBoxFrame);
|
||||
ShowNavButtons( back, next );
|
||||
|
@ -192,6 +192,20 @@ InAdditionsContent(EventRecord* evt, WindowPtr wCurrPtr)
|
|||
GlobalToLocal( &localPt);
|
||||
|
||||
/* Mouse Up */
|
||||
|
||||
/* scroll */
|
||||
SetRect(&r, gControls->aw->compListBox.right, gControls->aw->compListBox.top,
|
||||
gControls->aw->compListBox.right + kScrollBarWidth, gControls->aw->compListBox.bottom);
|
||||
if ((evt->what == mouseUp) && (PtInRect( localPt, &r)))
|
||||
{
|
||||
LClick(localPt, evt->modifiers, gControls->aw->compList);
|
||||
|
||||
SetRect(&r, gControls->aw->compListBox.left, gControls->aw->compListBox.top,
|
||||
gControls->aw->compListBox.right + 1, gControls->aw->compListBox.bottom);
|
||||
FrameRect(&r);
|
||||
}
|
||||
|
||||
/* or un/check components */
|
||||
if ((evt->what == mouseUp) && (PtInRect( localPt, &gControls->aw->compListBox)))
|
||||
{
|
||||
LClick(localPt, evt->modifiers, gControls->aw->compList);
|
||||
|
@ -324,7 +338,9 @@ UpdateAdditionsWin(void)
|
|||
DrawString( CToPascal(*gControls->cfg->selAddMsg));
|
||||
HUnlock(gControls->cfg->selAddMsg);
|
||||
LUpdate( (*gControls->aw->compList)->port->visRgn, gControls->aw->compList);
|
||||
FrameRect(&gControls->aw->compListBox);
|
||||
SetRect(&r, gControls->aw->compListBox.left, gControls->aw->compListBox.top,
|
||||
gControls->aw->compListBox.right + 1, gControls->aw->compListBox.bottom);
|
||||
FrameRect(&r);
|
||||
|
||||
SetPt(&c, 0, 0);
|
||||
if (LGetSelect(true, &c, gControls->aw->compList))
|
||||
|
|
|
@ -193,7 +193,9 @@ UpdateCompWin(void)
|
|||
DrawString( CToPascal(*gControls->cfg->selCompMsg));
|
||||
HUnlock(gControls->cfg->selCompMsg);
|
||||
LUpdate( (*gControls->cw->compList)->port->visRgn, gControls->cw->compList);
|
||||
FrameRect(&gControls->cw->compListBox);
|
||||
SetRect(&r, gControls->cw->compListBox.left, gControls->cw->compListBox.top,
|
||||
gControls->cw->compListBox.right + 1, gControls->cw->compListBox.bottom);
|
||||
FrameRect(&r);
|
||||
|
||||
SetPt(&c, 0, 0);
|
||||
if (LGetSelect(true, &c, gControls->cw->compList))
|
||||
|
@ -239,6 +241,20 @@ InComponentsContent(EventRecord* evt, WindowPtr wCurrPtr)
|
|||
GlobalToLocal( &localPt);
|
||||
|
||||
/* Mouse Up */
|
||||
|
||||
/* scroll */
|
||||
SetRect(&r, gControls->cw->compListBox.right, gControls->cw->compListBox.top,
|
||||
gControls->cw->compListBox.right + kScrollBarWidth, gControls->cw->compListBox.bottom);
|
||||
if ((evt->what == mouseUp) && (PtInRect( localPt, &r)))
|
||||
{
|
||||
LClick(localPt, evt->modifiers, gControls->cw->compList);
|
||||
|
||||
SetRect(&r, gControls->cw->compListBox.left, gControls->cw->compListBox.top,
|
||||
gControls->cw->compListBox.right + 1, gControls->cw->compListBox.bottom);
|
||||
FrameRect(&r);
|
||||
}
|
||||
|
||||
/* or un/check item */
|
||||
if ((evt->what == mouseUp) && (PtInRect( localPt, &gControls->cw->compListBox)))
|
||||
{
|
||||
LClick(localPt, evt->modifiers, gControls->cw->compList);
|
||||
|
|
|
@ -1183,6 +1183,7 @@ GetNextSection(char **ioTxt, char *outSectionName, char *outSection)
|
|||
|
||||
sbuf = outSection;
|
||||
cnt = 0;
|
||||
find_contents:
|
||||
while (*txt != START_SECTION && *txt != MY_EOF) /* next section encountered */
|
||||
{
|
||||
if( kSectionMaxLen-1 >= cnt++) /* prevent from falling of end of outSection buffer */
|
||||
|
@ -1193,6 +1194,21 @@ GetNextSection(char **ioTxt, char *outSectionName, char *outSection)
|
|||
else
|
||||
txt++;
|
||||
}
|
||||
|
||||
/* handle case where '[' is in key or value (i.e., for i18n)*/
|
||||
if (*txt == START_SECTION &&
|
||||
!(txt == *ioTxt || *(txt-1) == MAC_EOL || *(txt-1) == WIN_EOL))
|
||||
{
|
||||
if( kSectionMaxLen-1 >= cnt++) /* prevent from falling of end of outSection buffer */
|
||||
{
|
||||
*sbuf = *txt;
|
||||
sbuf++; txt++;
|
||||
}
|
||||
else
|
||||
txt++;
|
||||
goto find_contents;
|
||||
}
|
||||
|
||||
*sbuf = MY_EOF; /* close string */
|
||||
*ioTxt = txt; /* move txt ptr to next section */
|
||||
exists = true;
|
||||
|
|
Загрузка…
Ссылка в новой задаче