コード例 #1
0
ファイル: QueueListBox.cpp プロジェクト: fatman2021/FreeOrion
void QueueListBox::AcceptDrops(const std::vector<GG::Wnd*>& wnds, const GG::Pt& pt) {
    if (wnds.size() != 1)
        return;
    GG::Wnd* wnd = *wnds.begin();
    const std::string& drop_type = wnd->DragDropDataType();
    if (AllowedDropTypes().find(drop_type) == AllowedDropTypes().end())
        return;
    GG::ListBox::Row* row = boost::polymorphic_downcast<GG::ListBox::Row*>(wnd);
    if (!row)
        return;
    if (std::find(begin(), end(), row) == end())
        return;
    iterator it = RowUnderPt(pt);
    QueueItemMovedSignal(row, std::distance(begin(), it));
}
コード例 #2
0
ファイル: QueueListBox.cpp プロジェクト: Blue42hand/freeorion
void QueueListBox::AcceptDrops(const GG::Pt& pt, const std::vector<GG::Wnd*>& wnds, GG::Flags<GG::ModKey> mod_keys) {
    if (wnds.empty())
        return;
    if (wnds.size() > 1) {
        // delete any extra wnds that won't be processed below
        for (std::vector<GG::Wnd*>::const_iterator it = ++wnds.begin(); it != wnds.end(); ++it)
            delete *it;
        ErrorLogger() << "QueueListBox::AcceptDrops given multiple wnds unexpectedly...";
    }
    GG::Wnd* wnd = *wnds.begin();
    const std::string& drop_type = wnd->DragDropDataType();
    GG::ListBox::Row* row = boost::polymorphic_downcast<GG::ListBox::Row*>(wnd);
    if (AllowedDropTypes().find(drop_type) == AllowedDropTypes().end() ||
        !row ||
        std::find(begin(), end(), row) == end())
    {
        delete wnd;
        return;
    }
    iterator it = RowUnderPt(pt);
    QueueItemMovedSignal(row, std::distance(begin(), it));
}
コード例 #3
0
ファイル: platform_widget_utils.cpp プロジェクト: Syntaf/GG
GG::Pt NonClientSize(GG::Wnd& w)
{ return w.Size() - w.ClientSize(); }