示例#1
0
void UIHierarchy::Draw(const UIGeometricData &geometricData)
{
    if(needRedraw)
    {
        FullRedraw();
    }
    UIControl::Draw(geometricData);
}
void
GlueMapWindow::PanTo(const GeoPoint &location)
{
  follow_mode = FOLLOW_PAN;
  SetLocation(location);

  FullRedraw();
}
void
GlueMapWindow::PanTo(const GeoPoint &location)
{
  follow_mode = FOLLOW_PAN;
  visible_projection.SetGeoLocation(location);

  UpdateProjection();
  FullRedraw();
}
示例#4
0
文件: c_hilit.cpp 项目: dmcbride/efte
int EBuffer::HilitAddWord(const char *Word) {
    if (HilitFindWord(Word) == 1)
        return 1;
    WordList = (char **)realloc((void *)WordList, (1 + WordCount) * sizeof(char *));
    if (WordList == 0) return 0;
    WordList[WordCount++] = strdup(Word);
    FullRedraw();
    return 1;
}
示例#5
0
文件: e_cmds.cpp 项目: dmcbride/efte
int EBuffer::ChangeKeys(const char *AMode) {
    if ((Mode = FindMode(AMode)) != NULL) {
        HilitProc = 0;
        if (Mode->fColorize)
            HilitProc = GetHilitProc(Mode->fColorize->SyntaxParser);
        FullRedraw();
        return 1;
    }
    Msg(S_ERROR, "Mode '%s' not found.", AMode);
    return 0;
}
示例#6
0
文件: e_cmds.cpp 项目: dmcbride/efte
int EBuffer::ChangeFlags(const char *AMode) {
    if (EMode *XMode = FindMode(AMode)) {
        Flags = XMode->Flags;
        HilitProc = 0;
        if (Mode && Mode->fColorize)
            HilitProc = GetHilitProc(Mode->fColorize->SyntaxParser);
        FullRedraw();
        return 1;
    }
    Msg(S_ERROR, "Mode '%s' not found.", AMode);
    return 0;
}
void
GlueMapWindow::TogglePan()
{
  switch (follow_mode) {
  case FOLLOW_SELF:
    follow_mode = FOLLOW_PAN;
    break;

  case FOLLOW_PAN:
    follow_mode = FOLLOW_SELF;
    break;
  }

  FullRedraw();
}
示例#8
0
文件: c_hilit.cpp 项目: dmcbride/efte
int EBuffer::HilitRemoveWord(const char *Word) {
    for (int i = 0; i < WordCount; i++) {
        if (BFI(this, BFI_MatchCase) == 1) {
            if (strcmp(Word, WordList[i]) != 0) continue;
        } else {
            if (stricmp(Word, WordList[i]) != 0) continue;
        }
        free(WordList[i]);
        memmove(WordList + i, WordList + i + 1, sizeof(char *) * (WordCount - i - 1));
        WordCount--;
        WordList = (char **)realloc((void *)WordList, WordCount * sizeof(char *));
        FullRedraw();
        return 1;
    }
    return 0;
}
void
GlueMapWindow::SetPan(bool enable)
{
  switch (follow_mode) {
  case FOLLOW_SELF:
    if (!enable)
      return;

    follow_mode = FOLLOW_PAN;
    break;

  case FOLLOW_PAN:
    if (enable)
      return;

    follow_mode = FOLLOW_SELF;
    break;
  }

  FullRedraw();
}
示例#10
0
VOID DoWM_COMMAND(HWND hwnd, WPARAM wParam, LPARAM lParam)
{

    switch (HIWORD(wParam))
    {
    case EN_CHANGE:
        if (fileopen) {
            SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)DirtyMsg);
            filedirty = TRUE;
            TimerReset();
        }
        else {
            SendMessage(hStatus, SB_SETTEXT, 0, (LPARAM)"File not opened! (save or open new file).");
        }
        break;
    case BN_CLICKED:
        if (fileopen) {
            if (LOWORD(wParam) == BTN_OPENFOLDER)
                OpenFolder(hwnd);
            if (LOWORD(wParam) == BTN_REVERT)
                Revert(hwnd);
        }
        else {
            if (LOWORD(wParam) == BTN_OPENFILE)
                PromptAndLoadFile(hwnd);
        }
        break;
    
    
    
    }


    switch (LOWORD(wParam))
    {
    case ID_FILE_EXIT:
        PostMessage(hwnd, WM_CLOSE, 0, 0);
        break;
    case ID_VIEW_HEADERAREA:
    {
        HMENU hMenu = GetMenu(hwnd);
        statusarea = !statusarea;
        CheckMenuItem(hMenu, ID_VIEW_HEADERAREA, statusarea ? MF_CHECKED : MF_UNCHECKED);
        FullRedraw(hwnd);
        break;
    }
    case ID_VIEW_STATUSBAR:
    {   
        HMENU hMenu = GetMenu(hwnd);
        statusbar = !statusbar;
        CheckMenuItem(hMenu, ID_VIEW_STATUSBAR, statusbar ? MF_CHECKED : MF_UNCHECKED);
        ShowWindow(hStatus, statusbar);
        FullRedraw(hwnd);
        break;
    }

    case ID_VIEW_ORIGINALFILEDATA: 
    {
        HMENU hMenu = GetMenu(hwnd);
        OrigDataWindow = !OrigDataWindow;
        CheckMenuItem(hMenu, ID_VIEW_ORIGINALFILEDATA, statusbar ? MF_CHECKED : MF_UNCHECKED);
        ShowWindow(hOriginalDataWindow, OrigDataWindow);
        FullRedraw(hwnd);

        break;
    }

    }
}
示例#11
0
void UIHierarchy::Update(float32 timeElapsed)
{
    if(!delegate)
    {
        return;
    }
    
    if(needRedraw)
    {
        FullRedraw();
    }
    
    scroll->SetViewSize(size.y);
    
    float d = newPos - oldPos;
    oldPos = newPos;
    float32 newY = scroll->GetPosition(d, timeElapsed, lockTouch);
    if (scrollContainer->relativePosition.y != newY) 
    {
        scrollContainer->relativePosition.y = newY;

        List<UIControl*>::const_iterator it;
        Rect viewRect = GetGeometricData().GetUnrotatedRect();//GetRect(TRUE);
        const List<UIControl*> &scrollList = scrollContainer->GetChildren();
        List<UIControl*> removeList;
        
            //removing invisible elements
        for(it = scrollList.begin(); it != scrollList.end(); it++)
        {
            Rect crect = (*it)->GetGeometricData().GetUnrotatedRect();//GetRect(TRUE);
            if(crect.y <= viewRect.y - viewRect.dy || crect.y > viewRect.y + viewRect.dy*2)
            {
                removeList.push_back(*it);
            }
        }
        for(it = removeList.begin(); it != removeList.end(); it++)
        {
            scrollContainer->RemoveControl((*it));
        }
        
        UIControl *lastCell = NULL;
        UIControl *firstCell = NULL;
        int32 maxPos = -999999; 
        int32 minPos = 999999;
        for(it = scrollList.begin(); it != scrollList.end(); it++)
        {
            if ((*it)->relativePosition.y > maxPos) 
            {
                maxPos = (int32)(*it)->relativePosition.y;
                lastCell = (*it);
            }
            if ((*it)->relativePosition.y < minPos)
            {
                minPos = (int32)(*it)->relativePosition.y;
                firstCell = (*it);
            }
        }
        
        if(!scrollList.empty())
        {
            //adding elements to the list bottom
            if (lastCell) 
            {
                addPos = (int32)lastCell->relativePosition.y + cellHeight;
                if(addPos + (int32)scrollContainer->relativePosition.y <= size.y * 2)
                {
                    AddCellsAfter(((UIHierarchyCell *)lastCell)->node);
                }
            }
            
            //adding elements to the list top
            if (firstCell) 
            {
                addPos = (int32)firstCell->relativePosition.y - cellHeight;
                if(addPos + (int32)scrollContainer->relativePosition.y + cellHeight > -size.y)
                {
                    AddCellsBefore(((UIHierarchyCell *)firstCell)->node);
                }
            }
        }
        else
        {
            FullRedraw();
        }
    }
}