@@ -3579,6 +3579,7 @@ CMenu* GrabAMenu (void)
3579
3579
CString CMiniWindow::Menu (long Left, long Top, LPCTSTR Items, CMUSHView* pView)
3580
3580
{
3581
3581
CString strResult;
3582
+ int align = TPM_LEFTALIGN | TPM_TOPALIGN; // these are actually both zero
3582
3583
3583
3584
// can't menu if not visible
3584
3585
if (!m_bShow || m_bTemporarilyHide)
@@ -3606,60 +3607,62 @@ CString strResult;
3606
3607
p++;
3607
3608
}
3608
3609
3609
- vector<string> v;
3610
-
3611
- StringToVector (p, v, " |" );
3612
-
3613
- int iCount = v.size ();
3614
-
3615
- // must have at least one item
3616
- if (iCount < 1 )
3617
- return strResult;
3610
+ // alignment
3618
3611
3619
- #if 0 // AARRRRRRRRGGGGGGGGGGGHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!
3620
-
3621
- // if we are doing this in response to a mouse-down, we have to cancel the
3622
- // mouse-down event now, or things get confused
3623
-
3624
- if (!pView->m_sPreviousMiniWindow.empty ())
3612
+ if (*p == ' ~' && strlen (p) > 3 )
3625
3613
{
3626
- CMUSHclientDoc* pDoc = pView->GetDocument();
3627
-
3628
- MiniWindowMapIterator it = pDoc->m_MiniWindows.find (pView->m_sPreviousMiniWindow);
3629
-
3630
- if (it != pDoc->m_MiniWindows.end ())
3614
+ p++; // skip the '~'
3615
+ // horizontal alignment
3616
+ switch (*p++)
3631
3617
{
3618
+ case ' c' :
3619
+ case ' C' :
3620
+ align |= TPM_CENTERALIGN;
3621
+ break ;
3622
+ case ' l' :
3623
+ case ' L' :
3624
+ align |= TPM_LEFTALIGN;
3625
+ break ;
3626
+ case ' r' :
3627
+ case ' R' :
3628
+ align |= TPM_RIGHTALIGN;
3629
+ break ;
3630
+ default :
3631
+ // ignore
3632
+ break ;
3633
+ } // end of switch
3632
3634
3633
- CMiniWindow * old_mw = it->second;
3634
-
3635
- // cancel previous move-down hotspot
3636
- if (!old_mw->m_sMouseDownHotspot.empty ()) // HotspotId was used
3637
- {
3638
- // lookup that HotspotId
3639
- HotspotMapIterator it = old_mw->m_Hotspots.find (old_mw->m_sMouseDownHotspot);
3640
-
3641
- // call CancelMouseDown for that hotspot, if it exists
3642
- if (it != old_mw->m_Hotspots.end ())
3643
- {
3644
- m_last_mouseup = m_last_mousemove;
3645
- pView->Send_Mouse_Event_To_Plugin (old_mw->m_sCallbackPlugin,
3646
- it->second->m_sCancelMouseDown,
3647
- old_mw->m_sMouseDownHotspot);
3648
- }
3649
- old_mw->m_sMouseDownHotspot.erase (); // no mouse-down right now
3650
- } // we had previous hotspot
3651
-
3652
- } // previous window still exists
3635
+ // vertical alignment
3636
+ switch (*p++)
3637
+ {
3638
+ case ' c' :
3639
+ case ' C' :
3640
+ align |= TPM_VCENTERALIGN;
3641
+ break ;
3642
+ case ' b' :
3643
+ case ' B' :
3644
+ align |= TPM_BOTTOMALIGN;
3645
+ break ;
3646
+ case ' t' :
3647
+ case ' T' :
3648
+ align |= TPM_TOPALIGN;
3649
+ break ;
3650
+ default :
3651
+ // ignore
3652
+ break ;
3653
+ } // end of switch
3653
3654
3654
- pView->m_sPreviousMiniWindow.erase (); // no longer have a previous window
3655
- ReleaseCapture(); // Release the mouse capture established at
3656
- // the beginning of the mouse click.
3655
+ } // end of alignment code
3657
3656
3658
- } // released mouse in different window
3657
+ vector<string> v;
3659
3658
3660
- # endif // AARRRRRRRRGGGGGGGGGGGHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!
3659
+ StringToVector (p, v, " | " );
3661
3660
3661
+ int iCount = v.size ();
3662
3662
3663
+ // must have at least one item
3664
+ if (iCount < 1 )
3665
+ return strResult;
3663
3666
3664
3667
CPoint menupoint (Left, Top);
3665
3668
@@ -3734,7 +3737,7 @@ CPoint menupoint (Left, Top);
3734
3737
// without this line the auto-enable always set "no items" to active
3735
3738
Frame.m_bAutoMenuEnable = FALSE ;
3736
3739
3737
- int iResult = vPopup.front ()->TrackPopupMenu (TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD,
3740
+ int iResult = vPopup.front ()->TrackPopupMenu (align | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD,
3738
3741
menupoint.x ,
3739
3742
menupoint.y ,
3740
3743
pWndPopupOwner);
0 commit comments