Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1882 in orxonox.OLD for orxonox/branches/gui


Ignore:
Timestamp:
May 8, 2004, 8:27:03 PM (21 years ago)
Author:
bensch
Message:

orxonox/branches/gui/console: ready for appending to log.

Location:
orxonox/branches/gui/console
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/gui/console/orxonox_console.cc

    r1880 r1882  
    4343      gtk_box_pack_start(GTK_BOX(vbox_main), log.createLog(), TRUE, TRUE, 0);
    4444      gtk_box_pack_start(GTK_BOX(vbox_main), entry.createEntry(), FALSE, FALSE, 0);
     45      entry.setLog(&log);
    4546    }
    4647  gtk_container_add(GTK_CONTAINER(window), vbox_main);
    47  
    4848 
    4949  gtk_widget_show_all(window);
  • orxonox/branches/gui/console/orxonox_console_entry.cc

    r1881 r1882  
    4949      g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), entry);
    5050      gtk_box_pack_start(GTK_BOX(entrybox), button, FALSE, FALSE, 5);
    51 
    5251    }
    5352    gtk_container_add(GTK_CONTAINER(frame), entrybox);
     
    5655}
    5756
    58 void OrxonoxConsoleEntry::submit(GtkWidget *widget, GtkWidget* data)
     57void OrxonoxConsoleEntry::setLog(OrxonoxConsoleLog* log)
    5958{
    60   char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(data));
     59  consoleLog = log;
     60}
     61
     62
     63void OrxonoxConsoleEntry::submit(GtkWidget *widget, GtkWidget* entry)
     64{
     65  char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(entry));
    6166  printf("%s\n", entryText);
    62 
    63   gtk_entry_set_text(GTK_ENTRY(data),"");
     67  //sendtoLog(entryText);
     68  gtk_entry_set_text(GTK_ENTRY(entry),"");
    6469  // freen entryText;
    6570  return;
     
    6974void OrxonoxConsoleEntry::sendtoLog(char* submitText)
    7075{
    71   printf("submitting %s\n", submitText);
     76  consoleLog->appendText(submitText);
    7277
    7378  return;
  • orxonox/branches/gui/console/orxonox_console_entry.h

    r1881 r1882  
    2626 
    2727  GtkWidget* createEntry(void);
     28  void setLog(OrxonoxConsoleLog* log);
    2829  static void submit(GtkWidget *widget, GtkWidget* data);
    2930  void sendtoLog(char* submitText);
  • orxonox/branches/gui/console/orxonox_console_log.cc

    r1880 r1882  
    4242    gtk_container_set_border_width (GTK_CONTAINER(scrollframe), 5);
    4343   
    44     log = gtk_text_view_new();
    45     gtk_text_view_set_editable(GTK_TEXT_VIEW(log), FALSE);
    46     gtk_container_add(GTK_CONTAINER(scrollframe), log);
     44    logView = gtk_text_view_new();
     45    gtk_text_view_set_editable(GTK_TEXT_VIEW(logView), FALSE);
     46    log = gtk_text_view_get_buffer (GTK_TEXT_VIEW (logView));
     47    gtk_container_add(GTK_CONTAINER(scrollframe), logView);
    4748    gtk_container_add(GTK_CONTAINER(frame),scrollframe);
     49    a=3;   
     50    gtk_text_buffer_set_text (log, "Orxonox Console:\n", -1);
     51
    4852  }
    4953  return (frame);
     
    5256void OrxonoxConsoleLog::appendText(char* append)
    5357{
     58  char* buffer = new char;
     59  printf("%i\n",a);
     60  sprintf (buffer, "%s\n", append);
    5461  printf ("appending %s\n", append);
    55   /*  strcat(logtext, append);
    56   printf(logtext);
    57   return;*/
     62  gtk_text_buffer_insert_at_cursor (log, buffer, -1);
     63  return;
    5864}
    5965
  • orxonox/branches/gui/console/orxonox_console_log.h

    r1880 r1882  
    1616  GtkWidget *scrollframe;
    1717  GtkWidget *logbox;
    18   GtkWidget *log;
     18  GtkWidget *logView;
     19  GtkTextBuffer *log;
    1920  GtkWidget *label;
     21  int a;
    2022
    2123  char *logtext;
Note: See TracChangeset for help on using the changeset viewer.