int main(void) { Object *application, *window, *b1, *b2, *b3; application = ApplicationObject, SubWindow, window = WindowObject, MUIA_Window_Title, (IPTR) "Hide & Show", MUIA_Window_Activate, TRUE, WindowContents, (IPTR) VGroup, Child, (IPTR) HGroup, Child, (IPTR) SimpleButton("Visible all the time"), Child, (IPTR) (b1 = ImageButton("Click Hide or Show", "THEME:Images/Gadgets/Prefs/Test")), Child, (IPTR) SimpleButton("Visible all the time too"), End, Child, (IPTR) HGroup, Child, (IPTR) (b2 = SimpleButton("Hide")), Child, (IPTR) (b3 = SimpleButton("Show")), End, End, End, End; if (application) { ULONG sigs = 0; DoMethod ( window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (IPTR) application, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit ); DoMethod ( b2, MUIM_Notify, MUIA_Pressed, FALSE, (IPTR) b1, 3, MUIM_Set, MUIA_ShowMe, FALSE ); DoMethod ( b3, MUIM_Notify, MUIA_Pressed, FALSE, (IPTR) b1, 3, MUIM_Set, MUIA_ShowMe, TRUE ); set(window,MUIA_Window_Open,TRUE); while ( DoMethod ( application, MUIM_Application_NewInput, (IPTR) &sigs ) != MUIV_Application_ReturnID_Quit ) { if (sigs) { sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D); if (sigs & SIGBREAKF_CTRL_C) break; if (sigs & SIGBREAKF_CTRL_D) break; } } MUI_DisposeObject(application); } return 0; }
UserInterface::UserInterface(): _backgroundColor(ofColor(0, 174, 239)), _color(ofColor(255, 255, 255)), _highlightColor(ofColor(255, 255, 0)), _shadowColor(ofColor(30, 120, 165)), _iconPadding(10), _iconSize(30), _fontSize(18), _shadowOffset(ofVec2f(1, 1)), _projectName(""), _openProjectButton(ImageButton("images/archive.png", BUTTON_OPEN_PROJECT, false, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _newProjectButton(ImageButton("images/plus.png", BUTTON_NEW_PROJECT, false, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _saveProjectButton(ImageButton("images/save.png", BUTTON_SAVE_PROJECT, false, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _infoButton(ImageButton("images/info.png", BUTTON_INFO, true, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _toggleModeButton(ImageButton("images/light-down.png", BUTTON_TOGGLE_MODE, false, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _toolBrushButton(ImageButton("images/brush.png", BUTTON_TOOL_BRUSH, true, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _toolTranslateButton(ImageButton("images/hand.png", BUTTON_TOOL_TRANSLATE, true, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _toolRotateButton(ImageButton("images/cycle.png", BUTTON_TOOL_ROTATE, true, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)), _toolScaleButton(ImageButton("images/resize-full-screen.png", BUTTON_TOOL_SCALE, true, buttonSelectEvent, buttonDeselectEvent, _color, _highlightColor, _shadowColor)) { }
bool ImageButton(const Sprite& sprite, const int framePadding, const Color& bgColor, const Color& tintColor) { Rectf spriteSize = sprite.getGlobalBounds(); return ImageButton(sprite, Vector2f(spriteSize.width, spriteSize.height), framePadding, bgColor, tintColor); }
bool ImageButton(const Texture& texture, const int framePadding, const Color& bgColor, const Color& tintColor) { return ImageButton(texture, static_cast<Vector2f>(texture.getSize()), framePadding, bgColor, tintColor); }
SAVEDS ULONG mNew(struct IClass *cl,Object *obj,struct opSet *msg) { struct FloatIntData *data; double *D; ULONG Store; signed long int Limit; char *AllowChars, Width; APTR MyWin; /* This looks like cookbook code. */ if (!(obj = (Object *)DoSuperMethodA(cl,obj,(Msg)msg))) return(0); data = INST_DATA(cl,obj); data->FIFlags = NULL; data->MasterVariable = NULL; data->IncDecAmount = 1.0; data->MinAmount = 0; data->MaxAmount = FLT_MAX; if(Store = GetTagData(MUIA_FloatInt_IncDecInt, NULL, msg->ops_AttrList)) { Limit = *(signed long int *)(&Store); data->IncDecAmount = Limit; data->FIFlags &= ~FIOFlag_Frac; } /* if */ if(Store = GetTagData(MUIA_FloatInt_IncDecDouble, NULL, msg->ops_AttrList)) { D = (double *)Store; data->IncDecAmount = *D; data->FIFlags &= ~FIOFlag_Frac; } /* if */ if(Store = GetTagData(MUIA_FloatInt_IDFracDouble, NULL, msg->ops_AttrList)) { D = (double *)Store; data->IncDecAmount = *D; data->FIFlags |= FIOFlag_Frac; } /* if */ if(Store = GetTagData(MUIA_FloatInt_MaxValDouble, NULL, msg->ops_AttrList)) { D = (double *)Store; data->MaxAmount = *D; } /* if */ if(Store = GetTagData(MUIA_FloatInt_MinValDouble, NULL, msg->ops_AttrList)) { D = (double *)Store; data->MinAmount = *D; } /* if */ if(Store = GetTagData(MUIA_FloatInt_MaxValInt, NULL, msg->ops_AttrList)) { Limit = *(signed long int *)(&Store); data->MaxAmount = Limit; } /* if */ if(Store = GetTagData(MUIA_FloatInt_MinValInt, NULL, msg->ops_AttrList)) { Limit = *(signed long int *)(&Store); data->MinAmount = Limit; } /* if */ Width = GetTagData(MUIA_FloatInt_FieldWidth, 5, msg->ops_AttrList); if(Width > 10) Width = 10; if(Width < 1) Width = 1; data->FIFlags |= GetTagData(MUIA_FloatInt_VarType, NULL, msg->ops_AttrList); data->MasterVariable = (void *)GetTagData(MUIA_FloatInt_VarPtr, NULL, msg->ops_AttrList); data->LabelText = (char *)GetTagData(MUIA_FloatInt_LabelText, NULL, msg->ops_AttrList); /* make sure we have required args */ if(data->LabelText && data->MasterVariable && (data->FIFlags & FI_TypeMask)) { if(data->FIFlags & (FIOFlag_Float | FIOFlag_Double)) /* is it floating-point? */ { AllowChars = ".+-0123456789"; } /* if */ else { AllowChars = "+-0123456789"; } /* else */ data->group = HGroup, MUIA_Group_HorizSpacing, 0, Child, Label2(data->LabelText), Child, data->string = StringObject, StringFrame, MUIA_String_Accept, AllowChars, MUIA_FixWidthTxt, FWT[Width], End, Child, data->decbutton = ImageButton(MUII_ArrowLeft), Child, data->incbutton = ImageButton(MUII_ArrowRight), End; } /* if */ if (!data->group) { CoerceMethod(cl,obj,OM_DISPOSE); return(0); } get(data->string, MUIA_WindowObject, &MyWin); /* Set up notification for change of ActiveObject */ DoMethod(MyWin, MUIM_Notify, MUIA_Window_ActiveObject, MUIV_EveryTime, obj, 3, MUIM_FloatInt_ChangeFocus, MUIA_FloatInt_Focus, MUIV_TriggerValue); /* Set up notification for increment/decrement buttons */ DoMethod(data->decbutton, MUIM_Notify, MUIA_Pressed, FALSE, obj, 1, MUIM_FloatInt_Dec); DoMethod(data->incbutton, MUIM_Notify, MUIA_Pressed, FALSE, obj, 1, MUIM_FloatInt_Inc); /* Set up notification for string gadget */ DoMethod(data->string, MUIM_Notify, MUIA_Selected, FALSE, obj, 1, MUIM_FloatInt_Str); DoMethod(obj,OM_ADDMEMBER,data->group); mSync(cl, obj, msg); return((ULONG)obj); }
Widget BolfView(){ GtkTooltips *Tooltips; Tooltips=gtk_tooltips_new(); Widget Window, InputText, SearchButton, SelectType, Table, SelectText, Slider, News; Widget NijiaM, KamerM, HipHop, AfricaM; Widget MusicLabel, GameLabel, FunLabel, MovieLabel, SportLabel; GtkWidget *pageLayoutExpander, *scrolledWindow; pageLayoutExpander = gtk_expander_new_with_mnemonic("Page"); MusicLabel= gtk_label_new("Music"); GameLabel= gtk_label_new("Games"); FunLabel= gtk_label_new("Funny"); MovieLabel= gtk_label_new("Movies"); SportLabel= gtk_label_new("Sports"); // Warning = gtk_label_new("Click On Me \n If You wanna Quit \n Or Cancel if you dont"); //declaring the url entry; UrlText=gtk_entry_new(); gtk_entry_set_visibility(GTK_ENTRY(UrlText),TRUE); gtk_widget_set_size_request(UrlText,600,25); gtk_entry_set_text (GTK_ENTRY(UrlText),"http://DONOT WRITE HERE!!!!!!"); gtk_tooltips_set_tip(Tooltips,UrlText,"This is to displace th current URL",NULL); //declaring the search text InputText=gtk_entry_new(); gtk_entry_set_visibility(GTK_ENTRY(InputText),TRUE); gtk_widget_set_size_request(InputText,20,40); gtk_tooltips_set_tip(Tooltips,InputText,"Enter Your Search Here!!!!",NULL); /* create Webview */ web[count] = webkit_web_view_new(); //declaring the search button; SearchButton=gtk_button_new(); SearchButton=ImageButton("pictures/search.jpeg"); gtk_widget_set_size_request(SearchButton,130,80); gtk_tooltips_set_tip(Tooltips,SearchButton,"Search Button",NULL); g_signal_connect(SearchButton, "clicked", G_CALLBACK(InputConnect), InputText); //creating a slider Slider=MyEvent("pictures/ani1.gif"); //gtk_widget_set_size_request(Slider,1000,3000); gtk_tooltips_set_tip(Tooltips,Slider,"News",NULL); g_signal_connect_swapped(Slider, "button_press_event", G_CALLBACK(Newso),NULL); //creating news News=MyEvent("pictures/ani2.gif"); //gtk_widget_set_size_request(News,400,150); gtk_tooltips_set_tip(Tooltips,News,"News",NULL); g_signal_connect_swapped(News, "button_press_event", G_CALLBACK(Newso),NULL); //Music NijiaM=MyEvent("pictures/concour.jpeg"); gtk_widget_set_size_request(NijiaM,175,80); gtk_tooltips_set_tip(Tooltips,NijiaM,"Nijia Music",NULL); g_signal_connect_swapped(NijiaM, "button_press_event", G_CALLBACK(NijiaMusic),NULL); HipHop=MyEvent("pictures/hiphop.jpeg"); gtk_widget_set_size_request(HipHop,175,80); gtk_tooltips_set_tip(Tooltips,HipHop,"Hip, HOp, R&B",NULL); g_signal_connect_swapped(HipHop, "button_press_event", G_CALLBACK(HipHopMusic),NULL); KamerM=MyEvent("pictures/camerhits.jpeg"); gtk_widget_set_size_request(KamerM,175,80); gtk_tooltips_set_tip(Tooltips,KamerM,"Kamer Hits",NULL); g_signal_connect_swapped(KamerM, "button_press_event", G_CALLBACK(KamerHits),NULL); AfricaM=MyEvent("pictures/cam.jpeg"); gtk_widget_set_size_request(AfricaM,175,80); gtk_tooltips_set_tip(Tooltips,AfricaM,"Africa Music",NULL); g_signal_connect_swapped(AfricaM,"button_press_event",G_CALLBACK(AfricaMusic),NULL); //Movies Widget Nolly, Holly,Bolly, Horos; Nolly=MyEvent("pictures/nollywood.jpeg"); gtk_widget_set_size_request(Nolly,175,80); gtk_tooltips_set_tip(Tooltips,Nolly,"NollyWood(Nigeria Film Industry)",NULL); g_signal_connect_swapped(Nolly, "button_press_event", G_CALLBACK(Nollywood),NULL); Holly=MyEvent("pictures/hollywood.jpeg"); gtk_widget_set_size_request(Holly,175,80); gtk_tooltips_set_tip(Tooltips,Holly,"Hollywood(America Film Industry)",NULL); g_signal_connect_swapped(Holly, "button_press_event", G_CALLBACK(Hollywood),NULL); Bolly=MyEvent("pictures/bollywood.jpeg"); gtk_widget_set_size_request(Bolly,175,80); gtk_tooltips_set_tip(Tooltips,Bolly,"Bollywood(The Indians)",NULL); g_signal_connect_swapped(Bolly, "button_press_event", G_CALLBACK(Bollywood),NULL); Horos=MyEvent("pictures/horos.jpeg"); gtk_widget_set_size_request(Horos,175,80); gtk_tooltips_set_tip(Tooltips,Horos,"Horos Movies",NULL); g_signal_connect_swapped(Horos,"button_press_event",G_CALLBACK(Horosmov),NULL); //funny movies Widget African,American,Europe,Kids; African=MyEvent("pictures/basket.jpeg"); gtk_widget_set_size_request(African,175,80); gtk_tooltips_set_tip(Tooltips,African,"Africa Fun",NULL); g_signal_connect_swapped(African, "button_press_event", G_CALLBACK(AfricaFun),NULL); American=MyEvent("pictures/amerifun.jpeg"); gtk_widget_set_size_request(American,175,80); gtk_tooltips_set_tip(Tooltips,American,"American Fun",NULL); g_signal_connect_swapped(American, "button_press_event", G_CALLBACK(AmericaFun),NULL); Europe=MyEvent("pictures/africanfunny.jpeg"); gtk_widget_set_size_request(Europe,175,80); gtk_tooltips_set_tip(Tooltips,Europe,"General Fun",NULL); g_signal_connect_swapped(Europe, "button_press_event", G_CALLBACK(NijiaBoys),NULL); Kids=MyEvent("pictures/kids.jpeg"); gtk_widget_set_size_request(Kids,175,80); gtk_tooltips_set_tip(Tooltips,Kids,"Kid Movies And Funs",NULL); g_signal_connect_swapped(Kids,"button_press_event",G_CALLBACK(KidsMovies),NULL); //Games Widget Race,War,HerosGame,KidGame; Race=MyEvent("pictures/race.jpeg"); gtk_widget_set_size_request(Race,175,80); gtk_tooltips_set_tip(Tooltips,Race,"Racee Games",NULL); g_signal_connect_swapped(Race, "button_press_event", G_CALLBACK(RaceGame),NULL); War=MyEvent("pictures/war.jpeg"); gtk_widget_set_size_request(War,175,80); gtk_tooltips_set_tip(Tooltips,War,"War Games",NULL); g_signal_connect_swapped(War, "button_press_event", G_CALLBACK(WarGame),NULL); HerosGame=MyEvent("pictures/horos2.jpeg"); gtk_widget_set_size_request(HerosGame,175,80); gtk_tooltips_set_tip(Tooltips,HerosGame,"Horo Games",NULL); g_signal_connect_swapped(HerosGame, "button_press_event", G_CALLBACK(HeroGame),NULL); KidGame=MyEvent("pictures/kidgame.jpeg"); gtk_widget_set_size_request(KidGame,175,80); gtk_tooltips_set_tip(Tooltips,KidGame,"Games For Children",NULL); g_signal_connect_swapped(KidGame,"button_press_event",G_CALLBACK(KidGames),NULL); //sports Widget Foot,Basket,Resl,Others; Foot=MyEvent("pictures/fifa.png"); gtk_widget_set_size_request(Foot,175,80); gtk_tooltips_set_tip(Tooltips,Foot,"Football",NULL); g_signal_connect(Foot, "button_press_event", G_CALLBACK(Football),UrlText); Basket=MyEvent("pictures/basketball.jpeg"); gtk_widget_set_size_request(Basket,175,80); gtk_tooltips_set_tip(Tooltips,Basket,"Basketball",NULL); g_signal_connect(Basket, "button_press_event", G_CALLBACK(Basketball),UrlText); Resl=MyEvent("pictures/resling.jpeg"); gtk_widget_set_size_request(Resl,175,80); gtk_tooltips_set_tip(Tooltips,Resl,"Resling",NULL); g_signal_connect(Resl, "button_press_event", G_CALLBACK(Resling),UrlText); Others=MyEvent("pictures/games.jpeg"); gtk_widget_set_size_request(Others,175,80); gtk_tooltips_set_tip(Tooltips,Others,"Rugby,Handball, MotoGP, Athletic and Other sports",NULL); g_signal_connect(Others,"button_press_event",G_CALLBACK(OtherSports),UrlText); //define the select type of entertianment; SelectType=gtk_combo_new(); gtk_entry_set_text(GTK_ENTRY((GTK_COMBO(SelectType))-> entry),"Mp3 Music"); GList *list=NULL; list=g_list_append(list," Music Vidios"); list=g_list_append(list,"Movies"); list=g_list_append(list,"Games"); list=g_list_append(list,"Funny Vidio"); list=g_list_append(list,"News"); gtk_combo_set_popdown_strings(GTK_COMBO(SelectType),list); gtk_combo_set_case_sensitive(GTK_COMBO(SelectType),FALSE); //gtk_widget_set_size_request(SelectType,100,300); //getting the text from the combo SelectText=gtk_label_new(gtk_entry_get_text(GTK_ENTRY((GTK_COMBO(SelectType))->entry))); Widget back_button,forward_button,home_button,Iback,Iforward,Ihome; Iback=gtk_image_new_from_stock(GTK_STOCK_GO_BACK,1); Iforward=gtk_image_new_from_stock(GTK_STOCK_GO_FORWARD,1); Ihome=gtk_image_new_from_stock(GTK_STOCK_HOME,1); back_button = gtk_button_new(); gtk_container_add(GTK_CONTAINER(back_button),Iback); gtk_widget_set_size_request(back_button,40,40); gtk_tooltips_set_tip(Tooltips,back_button,"go back",NULL); forward_button = gtk_button_new(); gtk_container_add(GTK_CONTAINER(forward_button),Iforward); gtk_widget_set_size_request(forward_button,40,40); gtk_tooltips_set_tip(Tooltips,forward_button,"go forward",NULL); home_button=gtk_button_new(); gtk_container_add(GTK_CONTAINER(home_button),Ihome); gtk_tooltips_set_tip(Tooltips,home_button,"Home",NULL); //create a table and insert struffs. Table=gtk_table_new(50,50,FALSE); gtk_table_attach_defaults(GTK_TABLE(Table),UrlText,10,40,0,1); gtk_table_attach(GTK_TABLE(Table),back_button,8,10,0,1,1,1,0,0); gtk_table_attach(GTK_TABLE(Table),forward_button,40,42,0,1,1,1,0,0); gtk_table_attach_defaults(GTK_TABLE(Table),home_button,46,48,0,1); gtk_table_attach(GTK_TABLE(Table), Slider,12,25,12,14, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), News,30,35,12,14, 1, 1, 0, 0 ); //input search gtk_table_attach_defaults(GTK_TABLE(Table),InputText,15,30,15,18); gtk_table_attach_defaults(GTK_TABLE(Table),SelectType,30,32,15,18); gtk_table_attach(GTK_TABLE(Table),SearchButton,32,36,15,17, 1, 1, 0, 0 ); //Labels gtk_table_attach(GTK_TABLE(Table), MusicLabel,8,14,17,18, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), MovieLabel,16,22,17,18, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), FunLabel,24,30,17,18, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), GameLabel,32,38,17,18, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), SportLabel,40,46,17,18, 1, 1, 0, 0 ); //Music Search gtk_table_attach(GTK_TABLE(Table), AfricaM,8,14,18,25, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), NijiaM,8,14,26,30, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), KamerM,8,14,31,35, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), HipHop,8,14,36,40, 1, 1, 0, 0 ); //movies Search gtk_table_attach(GTK_TABLE(Table), Nolly,16,22,18,25, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Holly,16,22,26,30, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Bolly,16,22,31,35, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Horos,16,22,36,40, 1, 1, 0, 0 ); //Funny Vidios gtk_table_attach(GTK_TABLE(Table), African,24,30,18,25, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), American,24,30,26,30, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Europe,24,30,31,35, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Kids,24,30,36,40, 1, 1, 0, 0 ); //Game Search gtk_table_attach(GTK_TABLE(Table), Race,32,38,18,25, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), War,32,38,26,30, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), HerosGame,32,38,31,35, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), KidGame,32,38,36,40, 1, 1, 0, 0 ); //Sports gtk_table_attach(GTK_TABLE(Table), Foot,40,46,18,25, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Basket,40,46,26,30, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Resl,40,46,31,35, 1, 1, 0, 0 ); gtk_table_attach(GTK_TABLE(Table), Others,40,46,36,40, 1, 1, 0, 0 ); scrolledWindow = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(scrolledWindow), web[count]); gtk_widget_show_all(scrolledWindow); gtk_container_add( GTK_CONTAINER(pageLayoutExpander), scrolledWindow); gtk_table_attach_defaults(GTK_TABLE(Table), pageLayoutExpander,0,50,11,50); g_signal_connect_swapped(WEBKIT_WEB_VIEW(web[count]),"load-finished",G_CALLBACK(viewSearchedPage),pageLayoutExpander); g_signal_connect(InputText, "activate", G_CALLBACK(activate), web[count]); g_signal_connect(WEBKIT_WEB_VIEW(web[count]),"load-progress-changed",G_CALLBACK(progress),UrlText); g_signal_connect(WEBKIT_WEB_VIEW(web[count]),"load-finished",G_CALLBACK(finished),UrlText); g_signal_connect_swapped(G_OBJECT(Window), "destroy",G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(back_button, "clicked", G_CALLBACK(back), web[count]); g_signal_connect(forward_button, "clicked", G_CALLBACK(forward), web[count]); g_signal_connect(home_button, "clicked", G_CALLBACK(Home), web[count]); g_signal_connect(NijiaM, "button_press_event", G_CALLBACK(NijiaM), web[count]); return Table; }
GtkWidget *MakeEditBox(GripInfo *ginfo) { GripGUI *uinfo; GtkWidget *vbox,*hbox; GtkWidget *button; GtkWidget *label; GtkWidget *frame; GtkWidget *item; GtkWidget *check; GtkWidget *entry; GtkObject *adj; ID3Genre *id3_genre; gint id3_genre_count; int len; int dub_size; PangoLayout *layout; uinfo=&(ginfo->gui_info); frame=gtk_frame_new(NULL); vbox=gtk_vbox_new(FALSE,0); hbox=gtk_hbox_new(FALSE,3); label=gtk_label_new(_("Disc title")); /* This should be the longest string in the track edit section */ layout=gtk_widget_create_pango_layout(GTK_WIDGET(label), _("Track name")); pango_layout_get_size(layout,&len,NULL); len/=PANGO_SCALE; g_object_unref(layout); layout=gtk_widget_create_pango_layout(GTK_WIDGET(label), _("W")); pango_layout_get_size(layout,&dub_size,NULL); dub_size/=PANGO_SCALE; g_object_unref(layout); gtk_widget_set_usize(label,len,0); gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); gtk_widget_show(label); uinfo->title_edit_entry=gtk_entry_new_with_max_length(256); gtk_signal_connect(GTK_OBJECT(uinfo->title_edit_entry),"changed", GTK_SIGNAL_FUNC(TitleEditChanged),(gpointer)ginfo); gtk_entry_set_position(GTK_ENTRY(uinfo->title_edit_entry),0); gtk_box_pack_start(GTK_BOX(hbox),uinfo->title_edit_entry,TRUE,TRUE,0); gtk_widget_show(uinfo->title_edit_entry); gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0); gtk_widget_show(hbox); hbox=gtk_hbox_new(FALSE,3); label=gtk_label_new(_("Disc artist")); gtk_widget_set_usize(label,len,0); gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); gtk_widget_show(label); uinfo->artist_edit_entry=gtk_entry_new_with_max_length(256); gtk_signal_connect(GTK_OBJECT(uinfo->artist_edit_entry),"changed", GTK_SIGNAL_FUNC(ArtistEditChanged),(gpointer)ginfo); gtk_entry_set_position(GTK_ENTRY(uinfo->artist_edit_entry),0); gtk_box_pack_start(GTK_BOX(hbox),uinfo->artist_edit_entry,TRUE,TRUE,0); gtk_widget_show(uinfo->artist_edit_entry); gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0); gtk_widget_show(hbox); hbox=gtk_hbox_new(FALSE,3); label=gtk_label_new(_("ID3 genre:")); gtk_widget_set_usize(label,len,0); gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); gtk_widget_show(label); uinfo->id3_genre_combo=gtk_combo_new(); for(id3_genre_count=0;(id3_genre=ID3GenreByNum(id3_genre_count)); id3_genre_count++) { item = gtk_list_item_new_with_label(id3_genre->name); gtk_object_set_user_data(GTK_OBJECT(item), (gpointer)(id3_genre->num)); uinfo->id3_genre_item_list=g_list_append(uinfo->id3_genre_item_list,item); gtk_signal_connect(GTK_OBJECT(item),"select", GTK_SIGNAL_FUNC(ID3GenreChanged), (gpointer)ginfo); gtk_container_add(GTK_CONTAINER(GTK_COMBO(uinfo->id3_genre_combo)->list), item); gtk_widget_show(item); } gtk_box_pack_start(GTK_BOX(hbox),uinfo->id3_genre_combo,TRUE,TRUE,0); gtk_widget_show(uinfo->id3_genre_combo); SetID3Genre(ginfo,ginfo->ddata.data_id3genre); gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0); gtk_widget_show(hbox); hbox=gtk_hbox_new(FALSE,3); label=gtk_label_new(_("Disc year")); gtk_widget_set_usize(label,len,0); gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); gtk_widget_show(label); adj=gtk_adjustment_new(0,0,9999,1.0,5.0,0); uinfo->year_spin_button=gtk_spin_button_new(GTK_ADJUSTMENT(adj),0.5,0); gtk_signal_connect(GTK_OBJECT(uinfo->year_spin_button),"value_changed", GTK_SIGNAL_FUNC(YearEditChanged),(gpointer)ginfo); gtk_box_pack_start(GTK_BOX(hbox),uinfo->year_spin_button,TRUE,TRUE,0); gtk_widget_show(uinfo->year_spin_button); gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0); gtk_widget_show(hbox); hbox=gtk_hbox_new(FALSE,3); label=gtk_label_new(_("Track name")); gtk_widget_set_usize(label,len,0); gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); gtk_widget_show(label); uinfo->track_edit_entry=gtk_entry_new_with_max_length(256); gtk_signal_connect(GTK_OBJECT(uinfo->track_edit_entry),"changed", GTK_SIGNAL_FUNC(TrackEditChanged),(gpointer)ginfo); gtk_signal_connect(GTK_OBJECT(uinfo->track_edit_entry),"activate", GTK_SIGNAL_FUNC(EditNextTrack),(gpointer)ginfo); gtk_box_pack_start(GTK_BOX(hbox),uinfo->track_edit_entry,TRUE,TRUE,0); gtk_widget_show(uinfo->track_edit_entry); gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0); gtk_widget_show(hbox); uinfo->multi_artist_box=gtk_vbox_new(FALSE,0); hbox=gtk_hbox_new(FALSE,3); label=gtk_label_new(_("Track artist")); gtk_widget_set_usize(label,len,0); gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); gtk_widget_show(label); uinfo->track_artist_edit_entry=gtk_entry_new_with_max_length(256); gtk_signal_connect(GTK_OBJECT(uinfo->track_artist_edit_entry),"changed", GTK_SIGNAL_FUNC(TrackEditChanged),(gpointer)ginfo); gtk_box_pack_start(GTK_BOX(hbox),uinfo->track_artist_edit_entry, TRUE,TRUE,0); gtk_widget_show(uinfo->track_artist_edit_entry); gtk_box_pack_start(GTK_BOX(uinfo->multi_artist_box),hbox,FALSE,FALSE,0); gtk_widget_show(hbox); hbox=gtk_hbox_new(FALSE,3); label=gtk_label_new(_("Split:")); gtk_box_pack_start(GTK_BOX(hbox),label,FALSE,FALSE,0); gtk_widget_show(label); button=gtk_button_new_with_label(_("Title/Artist")); gtk_object_set_user_data(GTK_OBJECT(button),(gpointer)0); gtk_signal_connect(GTK_OBJECT(button),"clicked", GTK_SIGNAL_FUNC(SplitTitleArtist),(gpointer)ginfo); gtk_box_pack_start(GTK_BOX(hbox),button,FALSE,FALSE,0); gtk_widget_show(button); button=gtk_button_new_with_label(_("Artist/Title")); gtk_object_set_user_data(GTK_OBJECT(button),(gpointer)1); gtk_signal_connect(GTK_OBJECT(button),"clicked", GTK_SIGNAL_FUNC(SplitTitleArtist),(gpointer)ginfo); gtk_box_pack_start(GTK_BOX(hbox),button,FALSE,FALSE,0); gtk_widget_show(button); entry=MakeStrEntry(&uinfo->split_chars_entry,ginfo->title_split_chars, _("Split chars"),5,TRUE); gtk_widget_set_usize(uinfo->split_chars_entry, 5*dub_size,0); gtk_box_pack_end(GTK_BOX(hbox),entry,FALSE,FALSE,0); gtk_widget_show(entry); gtk_box_pack_start(GTK_BOX(uinfo->multi_artist_box),hbox,FALSE,FALSE,2); gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(vbox),uinfo->multi_artist_box,FALSE,FALSE,0); if(ginfo->ddata.data_multi_artist) gtk_widget_show(uinfo->multi_artist_box); hbox=gtk_hbox_new(FALSE,0); check=MakeCheckButton(&uinfo->multi_artist_button, &(ginfo->ddata.data_multi_artist), _("Multi-artist")); gtk_signal_connect(GTK_OBJECT(uinfo->multi_artist_button),"clicked", GTK_SIGNAL_FUNC(UpdateMultiArtist),(gpointer)ginfo); gtk_box_pack_start(GTK_BOX(hbox),check,TRUE,TRUE,0); gtk_widget_show(check); button=ImageButton(GTK_WIDGET(uinfo->app),uinfo->save_image); gtk_widget_set_style(button,uinfo->style_dark_grey); gtk_signal_connect(GTK_OBJECT(button),"clicked", GTK_SIGNAL_FUNC(SaveDiscInfo),(gpointer)ginfo); gtk_tooltips_set_tip(MakeToolTip(),button, _("Save disc info"),NULL); gtk_box_pack_start(GTK_BOX(hbox),button,FALSE,FALSE,0); gtk_widget_show(button); button=ImageButton(GTK_WIDGET(uinfo->app),uinfo->mail_image); gtk_widget_set_style(button,uinfo->style_dark_grey); gtk_signal_connect(GTK_OBJECT(button),"clicked", GTK_SIGNAL_FUNC(SubmitEntryCB),(gpointer)ginfo); gtk_tooltips_set_tip(MakeToolTip(),button, _("Submit disc info"),NULL); gtk_box_pack_start(GTK_BOX(hbox),button,FALSE,FALSE,0); gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0); gtk_widget_show(hbox); gtk_container_add(GTK_CONTAINER(frame),vbox); gtk_widget_show(vbox); return frame; }