Пример #1
0
static int InsertDeleteFromColumns(HDC hDC, struct resRes *menuData,
                                   MENUITEM **items, int x, int y, int fontHeight, 
                                    int code)
{
    MENUITEM **orig = items;
    int width = CalculateMenuWidth(hDC, *orig) + 28;
    if (x +width < menuData->gd.selectedColumn)
    {
        while (*items)
        {
            if ((*items)->expanded)
            {
                if ((*items)->popup)
                {
                    return InsertDeleteFromColumns(hDC, menuData, &(*items)->popup, x + width, y, fontHeight, code);
                }
                else 
                {
                    if (x + width + width > menuData->gd.selectedColumn)
                        if (y + fontHeight > menuData->gd.selectedRow && y <= menuData->gd.selectedRow)
                        {
                            DoInsert(menuData, &(*items)->popup, code, *items);
                            return 2;
                        }
                    return 0;
                }
            }
            y += fontHeight;
            items = &(*items)->next;
        }
    }
    else
    {
        while (*items)
        {
            if (y + fontHeight > menuData->gd.selectedRow)
            {
                DoInsert(menuData, items, code, NULL);
                return 1;
            }
            y += fontHeight;
            items = &(*items)->next;
        }
        if (y + fontHeight > menuData->gd.selectedRow)
        {
            DoInsert(menuData, items, code, NULL);
            return 2;
        }
    }
    return 0;
}
Пример #2
0
void Scene::Insert(Interactor* component, IntCoord x, IntCoord y, Alignment a) {
    Interactor* i = Wrap(component);
    PrepareToInsert(i);
    IntCoord ax = x, ay = y;
    DoAlign(i, a, ax, ay);
    DoInsert(i, true, ax, ay);
}
Пример #3
0
int wxItemContainer::Insert(const wxString& item, int pos, void *clientData)
{
    int n = DoInsert(item, pos);
    if ( n != wxNOT_FOUND )
        SetClientData(n, clientData);

    return n;
}
Пример #4
0
CIntervalTree::iterator CIntervalTree::Insert(const interval_type& interval,
                                              const mapped_type& value)
{
    TTreeMapI iter = m_ByX.insert(TTreeMapValue(interval.GetFrom(),
                                                interval.GetTo(),
                                                value));
    DoInsert(interval, iter);

    return iterator(0, TTraits::GetMaxCoordinate(), &TTreeMap::get(iter));
}
Пример #5
0
static int InsertDeleteFromTopRow(HDC hDC, struct resRes *menuData,
                                  MENUITEM **items, int fontHeight, int code)
{
    MENUITEM **orig = (*items);
    int x = 10;
    SIZE xx;
    while (*items)
    {

        GetTextExtentPoint32W(hDC, (*items)->text, wcslen((*items)->text), &xx);
        if ((*items)->expanded && menuData->gd.selectedRow > 10 + fontHeight)
        {
            if (menuData->gd.selectedColumn >= x)
                return InsertDeleteFromColumns(hDC, menuData, &(*items)->popup, x, 10+fontHeight, fontHeight, code);
            x += xx.cx+16;
        }
        else if (menuData->gd.selectedRow < 10 + fontHeight)
        {        
            if (menuData->gd.selectedColumn < x + xx.cx + 16)
            {
                DoInsert(menuData, items, code, NULL);
                return 1;
            }
            x += xx.cx+16;
        }
        else
        {
            x += xx.cx+16;
        }
        items = &(*items)->next;
    }
    if (menuData->gd.selectedColumn < x + xx.cx + 16)
    {
        DoInsert(menuData, items, code, NULL);
        return 2;
    }
    return 0;
}
Пример #6
0
wxMenuItem* wxMenuBase::Insert(size_t pos, wxMenuItem *item)
{
    wxCHECK_MSG( item, NULL, wxT("invalid item in wxMenu::Insert") );

    if ( pos == GetMenuItemCount() )
    {
        return DoAppend(item);
    }
    else
    {
        wxCHECK_MSG( pos < GetMenuItemCount(), NULL,
                     wxT("invalid index in wxMenu::Insert") );

        return DoInsert(pos, item);
    }
}
Пример #7
0
/*ARGSUSED*/
void 
_XawTextInsertFileAction(Widget w, XEvent *event,
			 String *params, Cardinal *num_params)
{
    DoInsert(w, (XtPointer)XtParent(XtParent(XtParent(w))), NULL);
}
Пример #8
0
// function appends a new item or submenu to the menu
wxMenuItem* wxMenu::DoAppend(wxMenuItem *pItem)
{
    return DoInsert(GetMenuItemCount(), pItem);
}
Пример #9
0
void Scene::Insert(Interactor* component) {
    Interactor* i = Wrap(component);
    PrepareToInsert(i);
    IntCoord left, bottom;
    DoInsert(i, false, left, bottom);
}
Пример #10
0
	// TODO: add a param for expiry time of this key.
	bool Insert(const key_type& key, const value_type& val)
		{ return DoInsert(key, val); }
Пример #11
0
int wxChoice::DoAppend(const wxString& item)
{
    return DoInsert(item, GetCount());
}
Пример #12
0
void Scene::Insert (Interactor* component) {
    Interactor* i = Wrap(component);
    PrepareToInsert(i);
    DoInsert(i, false, i->left, i->bottom);
}