Changeset 1880 in orxonox.OLD for orxonox/branches
- Timestamp:
- May 8, 2004, 1:56:59 PM (21 years ago)
- Location:
- orxonox/branches/gui/console
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/gui/console/Makefile
r1877 r1880 51 51 52 52 .cc.o: 53 @ echo "$@ is being com iled..."53 @ echo "$@ is being compiled..." 54 54 @ $(CXX) -c $(CFLAGS) -I$(INCDIR) -o $@ $< 55 55 -
orxonox/branches/gui/console/orxonox_console.cc
r1877 r1880 26 26 27 27 #include "orxonox_console.h" 28 28 29 using namespace std; 29 30 30 31 void OrxonoxConsole::createWindow () 31 32 { 32 OrxonoxConsoleEntry entry;33 OrxonoxConsoleLog log;34 35 33 36 34 window = gtk_window_new (GTK_WINDOW_TOPLEVEL); -
orxonox/branches/gui/console/orxonox_console.h
r1877 r1880 12 12 #include "orxonox_console_log.h" 13 13 14 OrxonoxConsoleLog log; 15 OrxonoxConsoleEntry entry; 16 14 17 class OrxonoxConsole { 15 18 -
orxonox/branches/gui/console/orxonox_console_entry.cc
r1877 r1880 27 27 #include "orxonox_console_entry.h" 28 28 29 OrxonoxConsoleEntry::OrxonoxConsoleEntry(OrxonoxConsoleLog* log) 30 { 31 consoleLog = log; 32 } 29 33 30 34 GtkWidget* OrxonoxConsoleEntry::createEntry() … … 38 42 { 39 43 entry = gtk_entry_new(); 44 g_signal_connect(GTK_ENTRY(entry), "activate", G_CALLBACK(submit), entry); 40 45 gtk_box_pack_start(GTK_BOX(entrybox), entry, TRUE, TRUE, 5); 41 46 42 47 43 48 button = gtk_button_new_with_label("Submit"); 49 g_signal_connect(GTK_BUTTON(button), "clicked", G_CALLBACK(submit), entry); 44 50 gtk_box_pack_start(GTK_BOX(entrybox), button, FALSE, FALSE, 5); 45 51 46 52 } 47 53 gtk_container_add(GTK_CONTAINER(frame), entrybox); … … 50 56 } 51 57 58 void 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 69 void 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 8 8 #include <gtk/gtk.h> 9 9 10 #include "orxonox_console_log.h" 11 10 12 class OrxonoxConsoleEntry { 11 13 … … 16 18 GtkWidget *button; 17 19 GtkWidget *entry; 20 OrxonoxConsoleLog* consoleLog; 18 21 19 22 20 23 21 24 public: 25 OrxonoxConsoleEntry(OrxonoxConsoleLog* log); 26 22 27 GtkWidget* createEntry(void); 23 24 28 static void submit(GtkWidget *widget, GtkWidget* data); 29 void sendtoLog(char* submitText); 25 30 26 31 }; 32 27 33 28 34 #endif -
orxonox/branches/gui/console/orxonox_console_log.cc
r1878 r1880 29 29 GtkWidget* OrxonoxConsoleLog::createLog() 30 30 { 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 } 46 49 return (frame); 47 50 } 48 51 52 void OrxonoxConsoleLog::appendText(char* append) 53 { 54 printf ("appending %s\n", append); 55 /* strcat(logtext, append); 56 printf(logtext); 57 return;*/ 58 } 59 60 void OrxonoxConsoleLog::clear() 61 { 62 sprintf(logtext, ""); 63 return; 64 } -
orxonox/branches/gui/console/orxonox_console_log.h
r1877 r1880 5 5 #include <stdio.h> 6 6 #include <stdlib.h> 7 #include <string.h> 7 8 8 9 /* GTK headers */ 9 #include <gtk/gtk.h> 10 #include <gtk/gtk.h> 10 11 11 12 class OrxonoxConsoleLog { … … 13 14 private: 14 15 GtkWidget *frame; 16 GtkWidget *scrollframe; 15 17 GtkWidget *logbox; 16 18 GtkWidget *log; 17 19 GtkWidget *label; 20 21 char *logtext; 18 22 19 23 … … 21 25 22 26 public: 27 23 28 GtkWidget* createLog(void); 24 29 25 26 30 void OrxonoxConsoleLog::appendText(char* append); 31 void OrxonoxConsoleLog::clear(); 27 32 }; 28 33
Note: See TracChangeset
for help on using the changeset viewer.