Example #1
0
Editor::Editor(Frame* parent, EditorSettings* set, int id)
  : WindowFrame(parent)
  , hFont(FontSys::getFont(set->font.size, L"Consolas", set->font.flags))
  , hFontIt(FontSys::getFont(set->font.size, L"Consolas", set->font.flags | FONT_ITALIC | FONT_BOLD))
  , hFontBf(FontSys::getFont(set->font.size, L"Consolas", set->font.flags | FONT_BOLD))
  , caret(0)
  , caretX(0)
  , selStart(0)
  , insertMode(true)
  , target(NULL)
  , historyPos(0)
  , origHistory(0)
  , running(NULL)
  , dragop(0)
  , hDC(NULL)
  , hBitmap(NULL)
  , dropPos(0)
  , currentLine(-1)
  , settings(set)
  , pCopyLine(NULL)
{
  cursors[cArrow] = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
  cursors[cBeam] = LoadCursor(NULL, MAKEINTRESOURCE(IDC_IBEAM));
  icons[iBreakpoint] = (HICON) LoadImage(getInstance(),
    MAKEINTRESOURCE(IDI_BREAKPOINT), IMAGE_ICON, 16, 16, 0);
  icons[iCurline] = (HICON) LoadImage(getInstance(),
    MAKEINTRESOURCE(IDI_CURLINE), IMAGE_ICON, 16, 16, 0);
  chSize = FontSys::getTextSize(hFont, L" ");
  scrollPos.x = scrollPos.y = 0;
  scrollAccum.x = scrollAccum.y;
  extent.x = extent.y = 0;
  lines.push();
  initkw();

  if (WNDCLASSEX* wcx = createclass(L"iLuaEditorWindow"))
  {
    wcx->style |= CS_DBLCLKS;
    RegisterClassEx(wcx);
  }
  create(L"", WS_CHILD | WS_TABSTOP | WS_HSCROLL | WS_VSCROLL, WS_EX_CLIENTEDGE);
  setId(id);

  enableTooltips();

  target = new DropTarget(this, CF_UNICODETEXT, DROPEFFECT_COPY | DROPEFFECT_MOVE);
}
HeroChart::HeroChart(Frame* parent)
    : WindowFrame(parent)
{
    create("", WS_VSCROLL | WS_CHILD | WS_VISIBLE, WS_EX_CLIENTEDGE);
    dota = NULL;
    taverns = NULL;
    textTags = NULL;
    numTaverns = 0;
    numTags = 0;
    contentHeight = 0;
    scrollPos = 0;
    curTavern = -1;

    setWidth(CHART_WIDTH + 22);

    rebuild();
    enableTooltips();
}