SDL_Widget* SDL_ButtonNew()
{    
    SDL_Button *button;
    SDL_Widget *widget;
    SDL_Object *object;

    button=(SDL_Button*)malloc(sizeof(SDL_Button));
    memset(button,0,sizeof(SDL_Button));

    widget=(SDL_Widget*)button;
    widget->Type            = SDL_ButtonGetType();
    widget->flags           = 0;
    
    object=(SDL_Object*)widget;
    
    SDL_SignalConnect(widget,"mousebuttondown",SDL_ButtonSignalMouseButtonDown,widget);
    SDL_SignalConnect(widget,"mousebuttonup",  SDL_ButtonSignalMouseButtonUp,  widget);
    SDL_SignalConnect(widget,"mousemotion",    SDL_ButtonSignalMouseMotion,    widget);
    SDL_SignalConnect(widget,"realize",        SDL_ButtonSignalRealize,        widget);
    SDL_SignalConnect(widget,"show",           SDL_ButtonSignalShow,           widget);

    button->State        = SDL_BUTTON_STATE_UP;
    button->Label        = NULL;

    button->Font         = &DefaultFont;
    button->height       = 10;
   
    return (SDL_Widget*)button;
}
Exemple #2
0
void drawEdit()
{
	input_edit = SDL_EditNew();
	SDL_WidgetSetDims(input_edit, 400, 300, 240, 25);
//	SDL_EditSetText(input_edit, "");
	SDL_SignalConnect(input_edit,"activate",(T_Signal_Callback)callback_input_edit, NULL);
	SDL_SignalConnect(input_edit,"changed",(T_Signal_Callback)callback_input_edit_changed, NULL);
	SDL_WidgetShow(input_edit);
}
void *SONGDBUI_CreateWindow(void *ts)
{
    SongdbWidgets *sw;


    sw=malloc(sizeof(SongdbWidgets));

    /* Create the notebook/tab section below the table*/
    sw->Tabs=gtk_notebook_new ();
    gtk_notebook_set_tab_pos (GTK_NOTEBOOK (sw->Tabs), GTK_POS_BOTTOM);
    gtk_fixed_put(GTK_FIXED(ts),sw->Tabs,30,270);
    gtk_widget_set_usize(sw->Tabs,500,310);
    gtk_widget_show (sw->Tabs);
    
#if 0
        SDL_SignalConnect(sw->Tabs,"switch-tab",SONGDB_ChangeDatabase,sw->Tabs);
#endif

#if 0
    /* Create buttons which change the tabs */
    while(Button)
    {
        switch(Button->action)
        {
            SDL_Widget *w;
        case BUTTON_CHANGE_DIR:
#endif
        {
            GtkWidget *w;
            w=gtk_button_new_with_label("Edit Group");
            gtk_fixed_put(GTK_FIXED(ts),w,50,610);
            gtk_widget_show(w);
        }
#if 0
            w=SDL_WidgetCreateR(SDL_BUTTON,Button->Rect);
            SDL_WidgetPropertiesOf(w,SET_NORMAL_IMAGE,IMG_Load(Button->normal));
            SDL_WidgetPropertiesOf(w,SET_PRESSED_IMAGE,IMG_Load(Button->pressed));
            SDL_SignalConnect(w,"clicked",SONGDBUI_ChangeGroupClicked,NULL);        
            break;
        }
        Button=Button->next;
    }
#endif
    activesong[0]=-1;
    activesong[1]=-1;

    return sw;
}
SDL_Widget* SDL_ToggleButtonNew()
{    
    SDL_ToggleButton *newbutton;
    SDL_Widget *widget;

    newbutton=(SDL_ToggleButton*)malloc(sizeof(SDL_ToggleButton));
    
    widget=(SDL_Widget*)newbutton;
    widget->Type            = SDL_ToggleButtonGetType();
    widget->Rect.x          = 0;
    widget->Rect.y          = 0;
    widget->Rect.w          = 0;
    widget->Rect.h          = 0;
    widget->flags           = 0;
    
    
    SDL_SignalConnect(widget,"mousebuttondown",SDL_SignalToggleButtonMouseButtonDown,newbutton);

    newbutton->disabled     = NULL; 
    newbutton->normal       = NULL;
    newbutton->highlighted  = NULL; 
    newbutton->pressed      = NULL; 
    newbutton->State        = SDL_BUTTON_STATE_UP;
    newbutton->Label        = NULL;
   
    return (SDL_Widget*)newbutton;
}
Exemple #5
0
void drawButtonNo()
{
	button_no = SDL_ButtonNew();
	SDL_WidgetSetDims(button_no, W_WIDTH - 300, W_HEIGHT - 40, 60, 30);
	SDL_ButtonSetLabel(button_no, "No");
	SDL_SignalConnect(button_no,"clicked",(T_Signal_Callback)callback_button_no, NULL);
	SDL_WidgetShow(button_no);
}
Exemple #6
0
void drawButtonYes()
{
	button_yes = SDL_ButtonNew();
	SDL_WidgetSetDims(button_yes, W_WIDTH - 400, W_HEIGHT - 40, 60, 30);
	SDL_ButtonSetLabel(button_yes, "Yes");
	SDL_SignalConnect(button_yes,"clicked",(T_Signal_Callback)callback_button_yes, NULL);
	SDL_WidgetShow(button_yes);
}
Exemple #7
0
void drawButtonEnsure()
{
	button_ensure = SDL_ButtonNew();
	SDL_WidgetSetDims(button_ensure, W_WIDTH - 100, W_HEIGHT - 40, 60, 30);
	SDL_ButtonSetLabel(button_ensure, "Ensure");
	SDL_SignalConnect(button_ensure,"clicked",(T_Signal_Callback)callback_button_ensure, NULL);
	SDL_WidgetShow(button_ensure);
}
Exemple #8
0
void drawButtonFinish()
{
	
	button_finish = SDL_ButtonNew();
	SDL_WidgetSetDims(button_finish, W_WIDTH - 180, W_HEIGHT - 40, 60, 30);
	SDL_ButtonSetLabel(button_finish, "Finish");
	SDL_SignalConnect(button_finish,"clicked",(T_Signal_Callback)callback_button_finish, NULL);
	SDL_WidgetShow(button_finish);
}
Exemple #9
0
void drawButtonRetest()
{
	
	button_retest = SDL_ButtonNew();
	SDL_WidgetSetDims(button_retest, W_WIDTH - 180, W_HEIGHT - 40, 60, 30);
	SDL_ButtonSetLabel(button_retest, "Retest");
	SDL_SignalConnect(button_retest,"clicked",(T_Signal_Callback)callback_button_retest, NULL);
	SDL_WidgetShow(button_retest);
}
Exemple #10
0
void drawButtonPoweroff()
{
	
	button_poweroff = SDL_ButtonNew();
	SDL_WidgetSetDims(button_poweroff, W_WIDTH - 100, W_HEIGHT - 40, 60, 30);
	SDL_ButtonSetLabel(button_poweroff, "Poweroff");
	SDL_SignalConnect(button_poweroff,"clicked",(T_Signal_Callback)callback_button_poweroff, NULL);
	SDL_WidgetShow(button_poweroff);
}
Exemple #11
0
void drawButtonLeave()
{
	
	button_leave = SDL_ButtonNew();
	SDL_WidgetSetDims(button_leave, W_WIDTH - 100, MARGIN + 50, 60, 30);
	SDL_ButtonSetLabel(button_leave, "Exit");
	SDL_SignalConnect(button_leave,"clicked",(T_Signal_Callback)callback_button_leave, NULL);
	SDL_WidgetShow(button_leave);

}
SDL_Widget* SDL_ScrollbarNew()
{
    SDL_Object *object;
    SDL_Scrollbar *scrollbar;
    SDL_Widget *widget;

    scrollbar = (SDL_Scrollbar*) malloc (sizeof(SDL_Scrollbar));
    memset(scrollbar,0,sizeof(SDL_Scrollbar));

    object    = (SDL_Object*) scrollbar;
    widget    = (SDL_Widget*) scrollbar;
    
    widget->Type      = SDL_ScrollbarGetType();
    widget->Rect.x    = 0;
    widget->Rect.y    = 0;
    widget->Rect.w    = 0;
    widget->Rect.h    = 0;
    widget->flags     = 0;

    scrollbar->State        = SCROLLBAR_IDLE;

    /* default range settings */
    scrollbar->MinValue           = 0;
    scrollbar->MaxValue           = 100;
    scrollbar->CurrentValue       = 0;
    scrollbar->NormalStepValue    = 50;


    scrollbar->PixelValue         = 0;
    scrollbar->Orientation        = VERTICAL;

    SDL_SignalConnect(widget, "keydown",        SDL_ScrollbarSignalKeyDown,         widget);
    SDL_SignalConnect(widget, "mousebuttondown",SDL_ScrollbarSignalMouseButtonDown, widget);
    SDL_SignalConnect(widget, "mousebuttonup",  SDL_ScrollbarSignalMouseButtonUp,   widget);
    SDL_SignalConnect(widget, "mousemotion",    SDL_ScrollbarSignalMouseMotion,     widget);
    SDL_SignalConnect(widget, "realize",        SDL_ScrollbarSignalRealize,         widget);
    return (SDL_Widget*)scrollbar;
}