Пример #1
0
void Notifications::Add(NotificationWnd *wnd, int groupId)
{
    if (groupId != 0)
        RemoveForGroup(groupId);
    wnd->groupId = groupId;

    if (wnds.Count() > 0)
        MoveBelow(wnds.At(wnds.Count() - 1), wnd);
    wnds.Append(wnd);
}
Пример #2
0
void Notifications::Add(NotificationWnd *wnd, int groupId)
{
    // use groupId to classify notifications and make a notification
    // replace any other notification of the same class
    if (groupId != 0)
        RemoveAllInGroup(groupId);
    wnd->groupId = groupId;

    if (wnds.Count() > 0)
        MoveBelow(wnds.At(wnds.Count() - 1), wnd);
    wnds.Append(wnd);
}
Пример #3
0
void Notifications::Remove(NotificationWnd *wnd)
{
    int ix = wnds.Find(wnd);
    if (ix == -1)
        return;
    wnds.Remove(wnd);
    if (ix == 0 && wnds.Count() > 0) {
        SetWindowPos(wnds.At(0)->hwnd(), NULL,
                     GetWndX(wnds.At(0)), NotificationWnd::TL_MARGIN,
                     0, 0, SWP_NOSIZE | SWP_NOZORDER);
        ix = 1;
    }
    for (size_t i = ix; i < wnds.Count(); i++) {
        MoveBelow(wnds.At(i - 1), wnds.At(i));
    }
}