#include "vg/vg.h"
static int skaterift_loaded = 0;
-static char g_an_buffer[ 4096 ];
+static char g_an_buffer[ 96 ],
+ g_an_buffer2[ 96 ];
int main( int argc, char *argv[] ){
vg_mem.use_libc_malloc = 0;
{ -1, "Minus One" }
};
static i32 dropdown_value = 8;
+static i32 checkbox_value = 0;
VG_STATIC void vg_gui(void){
if( !skaterift_loaded ) return;
vg_ui.wants_mouse = 1;
- ui_rect panel;
- if( vgi_window( window, "Test window", k_vgi_window_standard, panel ) ){
- ui_rect tmp;
- ui_split( panel, k_ui_axis_h, k_vgi_widget_height*k_vgi_scale,
- 0, tmp, panel );
- ui_enum( tmp, "Select enum:", dropdown_options, 3, &dropdown_value );
+ ui_rect panel, content;
+ ui_panel( window, panel );
+
+ static i32 page = 0;
+ ui_tabs( panel, content,
+ (const char *[]){ "Controls", "Other", "Nothing" }, 3, &page );
+
+ if( page == 0 ){
+ ui_enum( content, "Select enum:", dropdown_options, 3, &dropdown_value );
+ ui_checkbox( content, "Toggly:", &checkbox_value );
+ ui_textbox( content, "Single:", g_an_buffer, 96, 1, 0, NULL );
+ ui_textbox( content, "Multi:", g_an_buffer2, 96, 5, 0, NULL );
+
+ if( ui_button( content, "Hello" ) == 1 ){
+ vg_success( "Ding!\n" );
+ }
}
- else{
- /* window close */
+ else if( page == 1 ){
+ if( ui_button( content, "Another button" ) == 1 ){
+ vg_error( "Press\n" );
+ }
}
+
#if 0
ui_fill( window, ui_colour( k_ui_bg+1 ) );
ui_outline( window, 1, ui_colour( k_ui_bg+7 ) );