Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

awindowmenu.C

Go to the documentation of this file.
00001 #include "awindow.h"
00002 #include "awindowgui.h"
00003 #include "awindowmenu.h"
00004 #include "edl.h"
00005 #include "edlsession.h"
00006 #include "language.h"
00007 #include "mwindow.h"
00008 
00009 
00010 
00011 
00012 
00013 AssetListMenu::AssetListMenu(MWindow *mwindow, AWindowGUI *gui)
00014  : BC_PopupMenu(0, 
00015                 0, 
00016                 0, 
00017                 "", 
00018                 0)
00019 {
00020         this->mwindow = mwindow;
00021         this->gui = gui;
00022 }
00023 
00024 AssetListMenu::~AssetListMenu()
00025 {
00026 }
00027 
00028 void AssetListMenu::create_objects()
00029 {
00030         add_item(format = new AssetListFormat(mwindow));
00031         add_item(new AssetListSort(mwindow));
00032         update_titles();
00033 }
00034 
00035 void AssetListMenu::update_titles()
00036 {
00037         format->update();
00038 }
00039 
00040 
00041 
00042 
00043 
00044 
00045 
00046 
00047 AssetListFormat::AssetListFormat(MWindow *mwindow)
00048  : BC_MenuItem("")
00049 {
00050         this->mwindow = mwindow;
00051 }
00052 
00053 void AssetListFormat::update()
00054 {
00055         set_text(mwindow->edl->session->assetlist_format == ASSETS_TEXT ?
00056                 (char*)_("Display icons") : (char*)_("Display text"));
00057 }
00058 
00059 int AssetListFormat::handle_event()
00060 {
00061         switch(mwindow->edl->session->assetlist_format)
00062         {
00063                 case ASSETS_TEXT:
00064                         mwindow->edl->session->assetlist_format = ASSETS_ICONS;
00065                         break;
00066                 case ASSETS_ICONS:
00067                         mwindow->edl->session->assetlist_format = ASSETS_TEXT;
00068                         break;
00069         }
00070 
00071         mwindow->awindow->gui->asset_list->update_format(
00072                 mwindow->edl->session->assetlist_format, 
00073                 1);
00074 
00075         return 1;
00076 }
00077 
00078 
00079 
00080 
00081 AssetListSort::AssetListSort(MWindow *mwindow)
00082  : BC_MenuItem(_("Sort items"))
00083 {
00084         this->mwindow = mwindow;
00085 }
00086 
00087 int AssetListSort::handle_event()
00088 {
00089         mwindow->awindow->gui->sort_assets();
00090         return 1;
00091 }
00092 
00093 
00094 
00095 
00096 FolderListMenu::FolderListMenu(MWindow *mwindow, AWindowGUI *gui)
00097  : BC_PopupMenu(0, 
00098                 0, 
00099                 0, 
00100                 "", 
00101                 0)
00102 {
00103         this->mwindow = mwindow;
00104         this->gui = gui;
00105 }
00106 
00107 FolderListMenu::~FolderListMenu()
00108 {
00109 }
00110         
00111 void FolderListMenu::create_objects()
00112 {
00113         add_item(format = new FolderListFormat(mwindow, this));
00114         update_titles();
00115 }
00116 
00117 
00118 
00119 void FolderListMenu::update_titles()
00120 {
00121         format->set_text(mwindow->edl->session->folderlist_format == FOLDERS_TEXT ?
00122                 (char*)_("Display icons") : (char*)_("Display text"));
00123 }
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 FolderListFormat::FolderListFormat(MWindow *mwindow, FolderListMenu *menu)
00132  : BC_MenuItem("")
00133 {
00134         this->mwindow = mwindow;
00135         this->menu = menu;
00136 }
00137 int FolderListFormat::handle_event()
00138 {
00139         switch(mwindow->edl->session->folderlist_format)
00140         {
00141                 case ASSETS_TEXT:
00142                         mwindow->edl->session->folderlist_format = ASSETS_ICONS;
00143                         break;
00144                 case ASSETS_ICONS:
00145                         mwindow->edl->session->folderlist_format = ASSETS_TEXT;
00146                         break;
00147         }
00148 
00149         mwindow->awindow->gui->folder_list->update_format(mwindow->edl->session->folderlist_format, 1);
00150         menu->update_titles();
00151 
00152         return 1;
00153 }
00154 
00155 
00156 

Generated on Sun Jan 8 13:38:50 2006 for Cinelerra-svn by  doxygen 1.4.4