View *createView(int x, int y, int width, int height) { View *view = (View *)alloc(sizeof(View)); view = initWithViewFunction(view, x, y, width, height); (*view).clearView(view); return view; }
GridPanel *createGridPanel(int x, int y, int w, int h) { GridPanel *gridPanel = (GridPanel *)alloc(sizeof(GridPanel)); gridPanel = (GridPanel*)initWithViewFunction((View*)gridPanel, x, y, w, h); (*gridPanel).initPanel = initGridPanel; (*gridPanel).renderDataGrid = renderDataGrid; (*gridPanel).view.onMouseDown = onMouseDown; return gridPanel; }
StartButton *createStartButton(int x, int y, int w, int h, u32 sector) { StartButton *startButton = (StartButton *)allocMemory(sizeof(StartButton)); startButton = (StartButton*)initWithViewFunction((View*)startButton, x, y, w, h); (*startButton).initWithImage = initWithImage; Image *image = loadImageFromStorage(sector); (*startButton).initWithImage(startButton, image); return startButton; }
GraphPanel *createGraphPanel(int x, int y, int w, int h) { GraphPanel *graphPanel = (GraphPanel *)allocMemory(sizeof(GraphPanel)); graphPanel = (GraphPanel*)initWithViewFunction((View*)graphPanel, x, y, w, h); (*graphPanel).canvas = createView(x, y, w, h); (*graphPanel).initPanel = initGraphPanel; (*graphPanel).initPanel(graphPanel); (*graphPanel).view.onMouseDown = onMouseDown; return graphPanel; }
CoorPanel *createCoorPanel(int x, int y, int w, int h) { CoorPanel *coorPanel = (CoorPanel *)allocPage(sizeof(CoorPanel)); coorPanel = (CoorPanel *)initWithViewFunction((View*)coorPanel, x, y, w, h); (*coorPanel).canvas = createView(x, y, w, h); (*coorPanel).initPanel = initCoorPanel; (*coorPanel).initPanel(coorPanel); (*coorPanel).view.onMouseDown = onMouseDown; return coorPanel; }