Example #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;
}
Example #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);
}
Example #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;
}
Example #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));
}
Example #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;
}
Example #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);
    }
}
Example #7
0
/*ARGSUSED*/
void 
_XawTextInsertFileAction(Widget w, XEvent *event,
			 String *params, Cardinal *num_params)
{
    DoInsert(w, (XtPointer)XtParent(XtParent(XtParent(w))), NULL);
}
Example #8
0
// function appends a new item or submenu to the menu
wxMenuItem* wxMenu::DoAppend(wxMenuItem *pItem)
{
    return DoInsert(GetMenuItemCount(), pItem);
}
Example #9
0
void Scene::Insert(Interactor* component) {
    Interactor* i = Wrap(component);
    PrepareToInsert(i);
    IntCoord left, bottom;
    DoInsert(i, false, left, bottom);
}
Example #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); }
Example #11
0
int wxChoice::DoAppend(const wxString& item)
{
    return DoInsert(item, GetCount());
}
Example #12
0
void Scene::Insert (Interactor* component) {
    Interactor* i = Wrap(component);
    PrepareToInsert(i);
    DoInsert(i, false, i->left, i->bottom);
}