Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1880 in orxonox.OLD for orxonox


Ignore:
Timestamp:
May 8, 2004, 1:56:59 PM (21 years ago)
Author:
bensch
Message:

orxonox/branches/gui/console: made a little reaction.

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

Legend:

Unmodified
Added
Removed
  • orxonox/branches/gui/console/Makefile

    r1877 r1880  
    5151
    5252.cc.o:
    53         @ echo "$@ is being comiled..."
     53        @ echo "$@ is being compiled..."
    5454        @ $(CXX) -c $(CFLAGS) -I$(INCDIR) -o $@ $<
    5555
  • orxonox/branches/gui/console/orxonox_console.cc

    r1877 r1880  
    2626
    2727#include "orxonox_console.h"
     28
    2829using namespace std;
    2930
    3031void OrxonoxConsole::createWindow ()
    3132{
    32   OrxonoxConsoleEntry entry;
    33   OrxonoxConsoleLog log;
    34  
    3533 
    3634  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  • orxonox/branches/gui/console/orxonox_console.h

    r1877 r1880  
    1212#include "orxonox_console_log.h"
    1313
     14OrxonoxConsoleLog log;
     15OrxonoxConsoleEntry entry;
     16 
    1417class OrxonoxConsole {
    1518 
  • orxonox/branches/gui/console/orxonox_console_entry.cc

    r1877 r1880  
    2727#include "orxonox_console_entry.h"
    2828
     29OrxonoxConsoleEntry::OrxonoxConsoleEntry(OrxonoxConsoleLog* log)
     30{
     31  consoleLog = log;
     32}
    2933
    3034GtkWidget* OrxonoxConsoleEntry::createEntry()
     
    3842    {
    3943      entry = gtk_entry_new();
     44      g_signal_connect(GTK_ENTRY(entry), "activate", G_CALLBACK(submit), entry);
    4045      gtk_box_pack_start(GTK_BOX(entrybox), entry, TRUE, TRUE, 5);
    4146     
    4247     
    4348      button = gtk_button_new_with_label("Submit");
     49      g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), entry);
    4450      gtk_box_pack_start(GTK_BOX(entrybox), button, FALSE, FALSE, 5);
    45      
     51
    4652    }
    4753    gtk_container_add(GTK_CONTAINER(frame), entrybox);
     
    5056}
    5157
     58void OrxonoxConsoleEntry::submit(GtkWidget *widget, GtkWidget* data)
     59{
     60  char* entryText = (char*)gtk_entry_get_text(GTK_ENTRY(data));
     61  printf("%s\n", entryText);
     62
     63  gtk_entry_set_text(GTK_ENTRY(data),"");
     64  free (entryText);
     65  return;
     66}
     67
     68
     69void OrxonoxConsoleEntry::sendtoLog(char* submitText)
     70{
     71  printf("submitting %s\n", submitText);
     72
     73  return;
     74}
  • orxonox/branches/gui/console/orxonox_console_entry.h

    r1877 r1880  
    88#include <gtk/gtk.h>
    99
     10#include "orxonox_console_log.h"
     11
    1012class OrxonoxConsoleEntry {
    1113 
     
    1618  GtkWidget *button;
    1719  GtkWidget *entry;
     20  OrxonoxConsoleLog* consoleLog;
    1821 
    1922
    2023
    2124 public:
     25  OrxonoxConsoleEntry(OrxonoxConsoleLog* log);
     26 
    2227  GtkWidget* createEntry(void);
    23 
    24    
     28  static void submit(GtkWidget *widget, GtkWidget* data);
     29  void sendtoLog(char* submitText);
    2530
    2631};
     32 
    2733
    2834#endif
  • orxonox/branches/gui/console/orxonox_console_log.cc

    r1878 r1880  
    2929GtkWidget* OrxonoxConsoleLog::createLog()
    3030{
    31   //frame = gtk_frame_new ("Console Log:");
    32   frame = gtk_scrolled_window_new (NULL, NULL);
    33 
    34   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (frame),
    35                                   GTK_POLICY_AUTOMATIC,
    36                                   GTK_POLICY_AUTOMATIC);
    37 
    38   gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (frame),
    39                                        GTK_SHADOW_IN);
    40   gtk_container_set_border_width (GTK_CONTAINER(frame), 5);
    41  
    42   log = gtk_text_view_new();
    43   gtk_text_view_set_editable(GTK_TEXT_VIEW(log), FALSE);
    44   gtk_container_add(GTK_CONTAINER(frame), log);
    45  
     31  frame = gtk_frame_new ("Console Log:");
     32  {
     33    scrollframe = gtk_scrolled_window_new (NULL, NULL);
     34    logtext = new char;
     35   
     36    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollframe),
     37                                    GTK_POLICY_AUTOMATIC,
     38                                    GTK_POLICY_AUTOMATIC);
     39   
     40    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollframe),
     41                                         GTK_SHADOW_IN);
     42    gtk_container_set_border_width (GTK_CONTAINER(scrollframe), 5);
     43   
     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);
     47    gtk_container_add(GTK_CONTAINER(frame),scrollframe);
     48  }
    4649  return (frame);
    4750}
    4851
     52void OrxonoxConsoleLog::appendText(char* append)
     53{
     54  printf ("appending %s\n", append);
     55  /*  strcat(logtext, append);
     56  printf(logtext);
     57  return;*/
     58}
     59
     60void OrxonoxConsoleLog::clear()
     61{
     62  sprintf(logtext, "");
     63  return;
     64}
  • orxonox/branches/gui/console/orxonox_console_log.h

    r1877 r1880  
    55#include <stdio.h>
    66#include <stdlib.h>
     7#include <string.h>
    78
    89/* GTK headers */
    9 #include <gtk/gtk.h> 
     10#include <gtk/gtk.h>
    1011
    1112class OrxonoxConsoleLog {
     
    1314 private:
    1415  GtkWidget *frame;
     16  GtkWidget *scrollframe;
    1517  GtkWidget *logbox;
    1618  GtkWidget *log;
    1719  GtkWidget *label;
     20
     21  char *logtext;
    1822 
    1923 
     
    2125
    2226 public:
     27 
    2328  GtkWidget* createLog(void);
    2429
    25    
    26 
     30  void OrxonoxConsoleLog::appendText(char* append); 
     31  void OrxonoxConsoleLog::clear();
    2732};
    2833
Note: See TracChangeset for help on using the changeset viewer.