menu.c File Reference

#include <gtk/gtk.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include "search.c"

Go to the source code of this file.

Functions

void edit_copy ()
 Copy operation is done here.
void edit_cut ()
 All menu functions of the C editor are invoked with this function.
void edit_paste ()
 Paste operation is done here.
void edit_select ()
 select operation is done here
void file_new ()
 new file creation
void file_open ()
 Opening existing file.
void file_quit ()
 Quits the application.
void file_save ()
 Saving the file.
void file_saveas ()
 Save as operation.
void help_about ()
 This describes about the C-editor.
void help_contents ()
 Help function is called.
void search_find ()
 Find operation is done here.
void search_replace ()
 Replace operation is done here.
void show_about (void)
 This tells about the editor.
void show_help (void)
 Explains the functions available.

Variables

GtkWidget * entry
 These give entry text.
GtkItemFactory * main_menu
 Creates the main_menu.
GtkItemFactoryEntry menu_def []
 This is the GtkItemFactoryEntry structure used to generate new menus.
GtkWidget * view
 Creates the text_view.


Function Documentation

void edit_copy (  ) 

Copy operation is done here.

Definition at line 37 of file menu.c.

References buf.

void edit_cut (  ) 

All menu functions of the C editor are invoked with this function.

Definition at line 29 of file menu.c.

References buf.

void edit_paste (  ) 

Paste operation is done here.

Definition at line 45 of file menu.c.

References buf.

void edit_select (  ) 

select operation is done here

Definition at line 53 of file menu.c.

References buf.

void file_new (  ) 

new file creation

Definition at line 97 of file menu.c.

References buf, buf2, entry, filename, save_if_modified(), view, and window.

void file_open (  ) 

Opening existing file.

Definition at line 125 of file menu.c.

References buf, load_file(), save_if_modified(), and view.

void file_quit (  ) 

Quits the application.

Definition at line 158 of file menu.c.

References save_if_modified(), and window.

void file_save (  ) 

Saving the file.

Definition at line 143 of file menu.c.

References filename, and save_file().

void file_saveas (  ) 

Save as operation.

Definition at line 151 of file menu.c.

References save_file().

void help_about (  ) 

This describes about the C-editor.

Definition at line 88 of file menu.c.

References show_about().

void help_contents (  ) 

Help function is called.

Definition at line 81 of file menu.c.

References show_help().

void search_find (  ) 

Find operation is done here.

Definition at line 65 of file menu.c.

References textfind().

void search_replace (  ) 

Replace operation is done here.

Definition at line 73 of file menu.c.

References text_find_replace().

void show_about ( void   ) 

This tells about the editor.

Definition at line 219 of file search.c.

References window1.

Referenced by help_about().

void show_help ( void   ) 

Explains the functions available.

Definition at line 245 of file search.c.

References window1.

Referenced by help_contents().


Variable Documentation

GtkWidget* entry

These give entry text.

Definition at line 12 of file fileselect.c.

Referenced by file_new(), load_file(), main(), and save_file().

GtkItemFactory* main_menu

Creates the main_menu.

Definition at line 18 of file menu.c.

Referenced by main().

GtkItemFactoryEntry menu_def[]

Initial value:

 
  {
    { (char *)"/_File", NULL, NULL, 0, (char *)"<Branch>", NULL },
    { (char *)"/File/_New", (char *)"<control>N", file_new, 0, NULL },
    { (char *)"/File/_Open...", (char *)"<control>O", file_open, 0,NULL  },
    { (char *)"/File/_Save", (char *)"<control>S", file_save,0,NULL  },
    { (char *)"/File/Save _As...", NULL, file_saveas,0,NULL },
    { (char *)"/File/sep", NULL, NULL, 0, (char *)"<Separator>", NULL },
    { (char *)"/File/_Quit", (char *)"<control>Q", file_quit, 0,NULL },
    { (char *)"/_Edit", NULL, NULL, 0, (char *)"<Branch>", NULL },
    { (char *)"/Edit/C_ut", (char *)"<control>X", edit_cut, 0,NULL },
    { (char *)"/Edit/_Copy", (char *)"<control>C", edit_copy ,0,NULL },
    { (char *)"/Edit/_Paste", (char *)"<control>V", edit_paste, 0,NULL},
    { (char *)"/Edit/sep", NULL, NULL, 0, (char *)"<Separator>", NULL },
    { (char *)"/Edit/Select All", NULL, edit_select, NULL, NULL },
    { (char *)"/_Search", NULL, NULL, 0, (char *)"<Branch>", NULL },
    { (char *)"/Search/_Find",  (char *)"<control>F" , search_find, 0,NULL },
    { (char *)"/Search/_Replace", (char *)"<control>R" , search_replace, 0,NULL },
    { (char *)"/_Help", NULL, NULL, 0, (char *)"<Branch>", NULL },
    { (char *)"/Help/_Contents", (char *)"<control>H", help_contents,0,NULL },
    { (char *)"/Help/_About",  NULL , help_about, 0, "<Item>" },
    
  }
This is the GtkItemFactoryEntry structure used to generate new menus.

Item 1: The menu path. The letter after the underscore indicates an accelerator key once the menu is open. Item 2: The accelerator key for the entry Item 3: The callback function. Item 4: The callback action. This changes the parameters with which the function is called. The default is 0. Item 5: The item type, used to define what kind of an item it is. Here are the possible values:

NULL -> "<Item>" "" -> "<Item>" "<Title>" -> create a title item "<Item>" -> create a simple item "<CheckItem>" -> create a check item "<ToggleItem>" -> create a toggle item "<RadioItem>" -> create a radio item "<path>" -> path of a radio item to link against "<Separator>" -> create a separator "<Branch>" -> create an item to hold sub items (optional) "<LastBranch>" -> create a right justified branch

Definition at line 188 of file menu.c.

Referenced by main().

GtkWidget* view

Creates the text_view.

These give us text view widgets where all the typing is done.

Definition at line 13 of file menu.c.


Generated on Wed Apr 7 21:37:10 2010 for C_Editor by  doxygen 1.5.8