Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1819 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Apr 14, 2004, 1:46:35 AM (21 years ago)
Author:
bensch
Message:

orxonox/branches/bensch: added flags-frame

Location:
orxonox/branches/bensch
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/bensch/orxonox_gui.c

    r1818 r1819  
    22#include "orxonox_gui_video.h"
    33#include "orxonox_gui_audio.h"
    4 #include "orxonox_gui_exec.h"
    54int verbose = 1;
    65
  • orxonox/branches/bensch/orxonox_gui.h

    r1817 r1819  
    77#include <string.h>
    88#include <gtk/gtk.h>
     9
     10gint delete_event ( GtkWidget *widget, GdkEvent *event, gpointer data );
    911
    1012struct settings
  • orxonox/branches/bensch/orxonox_gui_audio.c

    r1818 r1819  
    1010
    1111  frame = gtk_frame_new ( "Audio-Options:");
     12  gtk_container_set_border_width (GTK_CONTAINER (frame), 5);
    1213  {
    1314    GtkWidget *orxonox_gui_audio_vbox;
  • orxonox/branches/bensch/orxonox_gui_exec.c

    r1818 r1819  
    1 #include "orxonox_gui.h"
    2 
     1#include "orxonox_gui_exec.h"
     2GtkWidget *exec_flags_label;
     3struct settings *exec_orxonox_settings;
    34GtkWidget *orxonox_gui_exec_frame (struct settings *orxonox_settings)
    45{
     
    89  GtkWidget *start_button;
    910  GtkWidget *quit_button;
     11  GtkWidget *flags_frame;
     12
    1013
    1114  frame = gtk_frame_new ( "Execute-Tags:");
     15  gtk_container_set_border_width (GTK_CONTAINER (frame), 5);
    1216  {
    1317    GtkWidget *orxonox_gui_exec_vbox;
    14     orxonox_gui_exec_vbox = gtk_vbox_new (FALSE, 0);
     18    orxonox_gui_exec_vbox = gtk_vbox_new (FALSE, 5);
    1519    {
    1620
     
    3034        g_signal_connect(GTK_BUTTON(quit_button), "clicked", G_CALLBACK(gtk_main_quit), NULL);
    3135        gtk_box_pack_start(GTK_BOX (orxonox_gui_exec_vbox), quit_button, FALSE, FALSE, 5);
     36
     37
     38        flags_frame = gtk_frame_new("Orxonox's starting Flags");
     39        {
     40          exec_flags_label = gtk_label_new("test");
     41          exec_orxonox_settings = orxonox_settings;
     42          orxonox_flags_update();
     43          gtk_container_add (GTK_CONTAINER(flags_frame), exec_flags_label);
     44        }
     45        gtk_box_pack_start(GTK_BOX (orxonox_gui_exec_vbox), flags_frame, FALSE, FALSE, 5);
    3246    }
    3347    gtk_container_add(GTK_CONTAINER(frame), orxonox_gui_exec_vbox);
     
    3852}
    3953
     54
     55char * orxonox_flags_text (struct settings *orxonox_settings, char *exec_flags_text)
     56{
     57  bzero(exec_flags_text, 1);
     58  strcat(exec_flags_text, "orxonox ");
     59
     60  if(!orxonox_settings->video_fullscreen)
     61    strcat(exec_flags_text, "--windowed ");
     62  if(orxonox_settings->video_wireframe)
     63    strcat(exec_flags_text, "--wireframe ");
     64 
     65  if(!orxonox_settings->audio_enable_sound)
     66    strcat(exec_flags_text, "--disable_audio ");
     67  /*  if(orxonox_settings->audio_music_volume <> 80)
     68    {
     69      strcat(exec_flags_text, "--music_volume=");
     70      strcat(exec_flags_text, sprintf("%i ",(int *)orxonox_settings->audio_music_volume));
     71    }
     72  */
     73  if(orxonox_settings->audio_effects_volume)
     74    strcat(exec_flags_text, "--effects_volume ");
     75
     76  return (exec_flags_text);
     77}
     78
     79void orxonox_flags_update (void)
     80{
     81  char exec_flags_text[1024];
     82  gtk_label_set_text (GTK_LABEL(exec_flags_label), orxonox_flags_text (exec_orxonox_settings, exec_flags_text));
     83  return;
     84}
  • orxonox/branches/bensch/orxonox_gui_exec.h

    r1818 r1819  
    11#ifndef _ORXONOX_GUI_EXEC_H
    22#define _ORXONOX_GUI_EXEC_H
     3#include "orxonox_gui.h"
    34
    45GtkWidget *orxonox_gui_exec_frame (struct settings *orxonox_settings);
     6char * orxonox_flags_text (struct settings *orxonox_settings, char *exec_flags_text);
     7void orxonox_flags_update (void);
    58
    69#endif /* _ORXONOX_GUI_EXEC_H */
  • orxonox/branches/bensch/orxonox_gui_video.c

    r1817 r1819  
    11#include "orxonox_gui_video.h"
    22
    3 
    4 
    5 
     3void video_option_change(GtkWidget *widget, gpointer data)
     4{
     5  data = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget));
     6  orxonox_flags_update ();
     7  if (verbose >=1)
     8    printf ("%s changed to %i.\n", gtk_button_get_label(widget), data);
     9}
    610
    711/* Drawing The VIDEO_FRAME */
     
    1317 
    1418  frame = gtk_frame_new ( "Video-Options:");
     19  gtk_container_set_border_width (GTK_CONTAINER (frame), 5);
     20
    1521  {
    1622    GtkWidget *orxonox_gui_video_vbox;
     
    1824    {
    1925        fullscreen_button = gtk_check_button_new_with_label ("Fullscreen-mode");
    20         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fullscreen_button), orxonox_settings->video_fullscreen);
    21 
    22         /*      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), orxonox_gui_video_fullscreen);
    23          */
     26        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (fullscreen_button), orxonox_settings->video_fullscreen);
     27        g_signal_connect(GTK_TOGGLE_BUTTON(fullscreen_button), "clicked", G_CALLBACK(video_option_change), &(orxonox_settings->video_fullscreen));
    2428        gtk_box_pack_start(GTK_BOX (orxonox_gui_video_vbox), fullscreen_button, TRUE, TRUE, 0);
    2529
    2630        wireframe_button = gtk_check_button_new_with_label ("Wireframe-mode");
    2731        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wireframe_button), orxonox_settings->video_wireframe);
    28         /*      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), orxonox_gui_video_Wireframe);
    29          */
     32        g_signal_connect(GTK_TOGGLE_BUTTON(wireframe_button), "clicked", G_CALLBACK(video_option_change), &(orxonox_settings->video_wireframe));
    3033        gtk_box_pack_start(GTK_BOX (orxonox_gui_video_vbox), wireframe_button, TRUE, TRUE, 0);
    3134       
  • orxonox/branches/bensch/orxonox_gui_video.h

    r1817 r1819  
    44#include "orxonox_gui.h"
    55
     6void video_option_change(GtkWidget *widget, gpointer data);
    67GtkWidget *orxonox_gui_video_frame (struct settings *orxonox_settings);
    78
Note: See TracChangeset for help on using the changeset viewer.