Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6482 → Rev 6481

/contrib/C_Layer/EXAMPLE/libguic_kolibri/option_menu.c
64,25 → 64,6
int option_index1 = 0; // index of selected option
int option_index2 = 0;
 
static char *menu1t = "Menu1";
static char *menu11t = "Set RED";
static char *menu12t = "Set GREEN";
static char *menu13t = "Set BLUE";
static char *menu14t = "";
menubar* menu1 = kolibri_new_menubar_def(X_Y(20, 40), X_Y(25, 15), 80, 100, menu1t, menu11t);
gui_add_menubar(main_window, menu1);
 
static char *menu2t = "Menu2";
static char *menu21t = "Set Option 1";
static char *menu22t = "Set Option 2";
static char *menu23t = "Set Option 3";
static char *menu24t = "";
menubar* menu2 = kolibri_new_menubar_def(X_Y(60, 40), X_Y(25, 15), 80, 100, menu2t, menu21t);
gui_add_menubar(main_window, menu2);
 
 
 
 
do /* Start of main activity loop */
{
if(option_index1 != option1sel - opts1)
/contrib/C_Layer/ASM/loadboxlib.asm
150,7 → 150,3
 
public option_box_draw as '_option_box_draw'
public option_box_mouse as '_option_box_mouse'
 
public menu_bar_draw as '_menu_bar_draw'
public menu_bar_mouse as '_menu_bar_mouse'
public menu_bar_activate as '_menu_bar_activate'
/contrib/C_Layer/INCLUDE/kolibri_menubar.h
File deleted
/contrib/C_Layer/INCLUDE/kolibri_gui_elements.h
30,8 → 30,6
KOLIBRI_NUM_GUI_ELEMENTS
};
 
#define X_Y(x,y) (((x)<<16)|(y))
 
/* Linked list which connects together all the elements drawn inside a GUI window */
typedef struct{
enum KOLIBRI_GUI_ELEMENT_TYPE type;
73,8 → 71,8
#include "kolibri_scrollbar.h"
#include "kolibri_statictext.h"
#include "kolibri_optionbox.h"
#include "kolibri_menubar.h"
 
#define X_Y(x,y) (((x)<<16)|(y))
 
 
 
131,11 → 129,7
kolibri_gui_op_table[KOLIBRI_OPTIONGROUP].mouse_fn = (cb_elem_boxlib)option_box_mouse;
kolibri_gui_op_table[KOLIBRI_OPTIONGROUP].key_fn = NULL;
 
kolibri_gui_op_table[KOLIBRI_MENU_BAR].redraw_fn = (cb_elem_boxlib)menu_bar_draw;
kolibri_gui_op_table[KOLIBRI_MENU_BAR].mouse_fn = (cb_elem_boxlib)menu_bar_mouse;
kolibri_gui_op_table[KOLIBRI_MENU_BAR].key_fn = NULL;
 
debug_board_printf("KOLIBRI_MENU_BAR (%x,%x,%x)\n", menu_bar_draw,menu_bar_mouse,menu_bar_activate);
debug_board_printf("KOLIBRI_OPTIONGROUP (%x,%x,%x)\n", option_box_draw,option_box_mouse,0);
}
 
/* Create a new main GUI window for KolibriOS */
/contrib/C_Layer/INCLUDE/kolibri_checkbox.h
39,7 → 39,7
new_checkbox -> left_s = (tlx << 16) + sizex;
new_checkbox -> top_s = (tly << 16) + sizey;
new_checkbox -> ch_text_margin = 10;
new_checkbox -> color = kolibri_color_table.color_work_area; // 0xFFFFFFFF; // 0x80AABBCC, 31-bit mus be set asciiz
new_checkbox -> color = 0xFFFFFFFF; // 0x80AABBCC, 31-bit mus be set asciiz
new_checkbox -> border_color = kolibri_color_table.color_work_graph;
new_checkbox -> text_color = kolibri_color_table.color_work_text;
new_checkbox -> text = label_text;
/contrib/C_Layer/INCLUDE/kolibri_scrollbar.h
33,10 → 33,10
uint32_t ar_offset;
} scrollbar;
 
inline scrollbar* kolibri_scrollbar(scrollbar* sb, uint32_t x_w, uint32_t y_h, uint32_t btn_height, uint32_t max_area,
scrollbar* kolibri_new_scrollbar(uint32_t x_w, uint32_t y_h, uint32_t btn_height, uint32_t max_area,
uint32_t cur_area, uint32_t position, uint32_t back_color, uint32_t front_color, uint32_t line_color)
{
memset(sb, 0, sizeof(scrollbar));
scrollbar *sb = (scrollbar *)calloc(1, sizeof(scrollbar));
 
sb->x_w = x_w;
sb->y_h = y_h;
45,42 → 45,16
sb->max_area = max_area;
sb->cur_area = cur_area;
sb->position = position;
sb->line_color = line_color;
sb->back_color = back_color; // 0xeeeeee
sb->front_color = front_color; // 0xbbddff
sb->line_color = 0; //line_color; // 0
sb->back_color = 0xeeeeee; // back_color; // 0xeeeeee
sb->front_color = 0xbbddff; //front_color; // 0xbbddff
sb->ar_offset = max_area / 30; // temporary step 3%
sb->all_redraw = 1;
return sb;
};
 
inline scrollbar* kolibri_new_scrollbar(uint32_t x_w, uint32_t y_h, uint32_t btn_height, uint32_t max_area,
uint32_t cur_area, uint32_t position, uint32_t back_color, uint32_t front_color, uint32_t line_color)
{
scrollbar *sb = (scrollbar *)malloc(sizeof(scrollbar));
//use_optionbox_driver
 
return kolibri_scrollbar(sb, x_w, y_h, btn_height, max_area, cur_area, position, back_color, front_color, line_color);
};
 
inline scrollbar* kolibri_scrollbar_def(scrollbar* sb, uint32_t x_w, uint32_t y_h, uint32_t max_area, uint32_t cur_area, uint32_t position)
{
return kolibri_scrollbar(sb, x_w, y_h, 15, max_area, cur_area, position, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, kolibri_color_table.color_work_button_text);
};
 
inline scrollbar* kolibri_new_scrollbar_def(uint32_t x_w, uint32_t y_h, uint32_t max_area, uint32_t cur_area, uint32_t position)
{
return kolibri_new_scrollbar(x_w, y_h, 15, max_area, cur_area, position, kolibri_color_table.color_work_area, kolibri_color_table.color_work_button, kolibri_color_table.color_work_button_text);
};
 
inline void gui_add_scrollbar_h(kolibri_window *wnd, scrollbar* sb)
{
kolibri_window_add_element(wnd, KOLIBRI_SCROLL_BAR_H, sb);
}
 
inline void gui_add_scrollbar_v(kolibri_window *wnd, scrollbar* sb)
{
kolibri_window_add_element(wnd, KOLIBRI_SCROLL_BAR_V, sb);
}
 
extern void (*scrollbar_h_draw)(scrollbar*) __attribute__((__stdcall__));
extern void (*scrollbar_h_mouse)(scrollbar*) __attribute__((__stdcall__));
extern void (*scrollbar_v_draw)(scrollbar*) __attribute__((__stdcall__));