Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1890 in orxonox.OLD for orxonox


Ignore:
Timestamp:
May 12, 2004, 5:25:46 PM (21 years ago)
Author:
bensch
Message:

orxonox/branches/gui/console: modularity improoved…. made the last changes even better.

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

Legend:

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

    r1884 r1890  
    4444      gtk_box_pack_start(GTK_BOX(vbox_main), log.createLog(), TRUE, TRUE, 0);
    4545      gtk_box_pack_start(GTK_BOX(vbox_main), entry.createEntry(), FALSE, FALSE, 0);
    46       entry.setLog(&log,&entry);
     46      entry.setLog(&log);
    4747    }
    4848  gtk_container_add(GTK_CONTAINER(window), vbox_main);
     
    5757int main( int argc, char *argv[] )
    5858
     59  verbose = 0;
     60
    5961  OrxonoxConsole console;
    6062 
  • orxonox/branches/gui/console/orxonox_console.h

    r1880 r1890  
    1212#include "orxonox_console_log.h"
    1313
    14 OrxonoxConsoleLog log;
    15 OrxonoxConsoleEntry entry;
     14int verbose;
    1615 
    1716class OrxonoxConsole {
     
    2019  GtkWidget *window;
    2120  GtkWidget *vbox_main;
     21  OrxonoxConsoleLog log;
     22  OrxonoxConsoleEntry entry;
    2223
    2324
  • orxonox/branches/gui/console/orxonox_console_entry.cc

    r1884 r1890  
    4949    {
    5050      entry = gtk_entry_new();
    51       g_signal_connect(GTK_ENTRY(entry), "activate", G_CALLBACK(submit), entry);
     51      //g_signal_connect(GTK_ENTRY(entry), "activate", G_CALLBACK(submit), entry);
    5252      gtk_box_pack_start(GTK_BOX(entrybox), entry, TRUE, TRUE, 5);
    5353     
    5454     
    5555      button = gtk_button_new_with_label("Submit");
    56       g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), entry);
     56      g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), this);
    5757      gtk_box_pack_start(GTK_BOX(entrybox), button, FALSE, FALSE, 5);
    5858    }
     
    6262}
    6363
    64 void OrxonoxConsoleEntry::setLog(OrxonoxConsoleLog* log, OrxonoxConsoleEntry* entry)
     64void OrxonoxConsoleEntry::setLog(OrxonoxConsoleLog* log)
    6565{
    6666  consoleLog = log;
    67   test = entry;
    6867}
    6968
    7069
    71 void OrxonoxConsoleEntry::submit(GtkWidget *widget, GtkWidget* entry)
     70void OrxonoxConsoleEntry::submit(GtkWidget *widget,  OrxonoxConsoleEntry* entry)
    7271{
    73   char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(entry));
    74   printf("%s\n", entryText);
    75   test->sendtoLog(entryText);
    76   gtk_entry_set_text(GTK_ENTRY(entry),"");
    77   // freen entryText;
     72  char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(entry->entry));
     73  entry->sendtoLog(entryText);
     74  gtk_entry_set_text(GTK_ENTRY(entry->entry),"");
     75  entryText;
    7876  return;
    7977}
  • orxonox/branches/gui/console/orxonox_console_entry.h

    r1884 r1890  
    1010#include "orxonox_console_log.h"
    1111
     12extern int verbose;
     13
    1214class OrxonoxConsoleEntry {
    1315 
     
    2022  OrxonoxConsoleLog* consoleLog;
    2123
    22   static OrxonoxConsoleEntry* test;
    23  
    2424
    2525
     
    2828 
    2929  GtkWidget* createEntry(void);
    30   void setLog(OrxonoxConsoleLog* log, OrxonoxConsoleEntry* entry);
    31   static void submit(GtkWidget *widget, GtkWidget* data);
     30  void setLog(OrxonoxConsoleLog* log);
     31  static void submit(GtkWidget *widget,  OrxonoxConsoleEntry* entry);
    3232  void sendtoLog(char* submitText);
    3333
  • orxonox/branches/gui/console/orxonox_console_log.cc

    r1882 r1890  
    4747    gtk_container_add(GTK_CONTAINER(scrollframe), logView);
    4848    gtk_container_add(GTK_CONTAINER(frame),scrollframe);
    49     a=3;   
    5049    gtk_text_buffer_set_text (log, "Orxonox Console:\n", -1);
    5150
     
    5756{
    5857  char* buffer = new char;
    59   printf("%i\n",a);
    6058  sprintf (buffer, "%s\n", append);
    61   printf ("appending %s\n", append);
     59  if (verbose>=1)
     60    printf ("appending %s\n", append);
    6261  gtk_text_buffer_insert_at_cursor (log, buffer, -1);
    6362  return;
  • orxonox/branches/gui/console/orxonox_console_log.h

    r1882 r1890  
    1010#include <gtk/gtk.h>
    1111
     12extern int verbose;
     13
    1214class OrxonoxConsoleLog {
    1315 
     
    1921  GtkTextBuffer *log;
    2022  GtkWidget *label;
    21   int a;
    2223
    2324  char *logtext;
Note: See TracChangeset for help on using the changeset viewer.