MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / MyMenuCallback

Method MyMenuCallback

src/csvmenu.cpp:187–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185
186
187void CsvMenu::MyMenuCallback(Fl_Widget *w, void *data) {
188 char ipath[256];
189
190 TC_CSVMENU_MENU_BAR_CLASS *bar = (TC_CSVMENU_MENU_BAR_CLASS*)w; // Get the menubar widget
191 const Fl_Menu_Item *item = bar->mvalue(); // Get the menu item that was picked
192 bar->item_pathname(ipath, sizeof(ipath)); // Get full pathname of picked item
193
194 if( strcmp(item->label(), "&New") == 0 ) {
195 app.createNewWindow();
196 } else if( strcmp(item->label(), TCRUNCHER_MENUTEXT_OPEN) == 0 ) {
197 app.openFile(false);
198 } else if( strcmp(item->label(), "&Open with format ...") == 0 ) {
199 app.openFile(true);
200 } else if( strcmp(item->label(), "&Reopen ...") == 0 ) {
201 app.openFile(true, true);
202 } else if( strcmp(item->label(), "&Save") == 0 ) {
203 app.saveFileCB(NULL, NULL);
204 } else if( strcmp(item->label(), "&Save As ...") == 0 ) {
205 app.saveFileAsCB(NULL, NULL);
206 } else if( strcmp(item->label(), "&Split CSV ...") == 0 ) {
207 app.splitCsvCB(NULL, NULL);
208 } else if( strcmp(item->label(), "&Export JSON ...") == 0 ) {
209 app.exportJsonCB(NULL, NULL);
210 } else if( strcmp(item->label(), "&Close") == 0 ) {
211 app.closeWindow();
212 } else if( strcmp(item->label(), "&Set CSV Properties ...") == 0 ) {
213 app.setCsvPropertiesCB(NULL, NULL);
214 } else if( strcmp(item->label(), "&Info") == 0 ) {
215 app.showInfoWindowCB(NULL, NULL);
216 } else if( strcmp(item->label(), "&Quit") == 0 ) {
217 app.quitApplication(true);
218 } else if( strcmp(item->label(), TCRUNCHER_MENUTEXT_UNDO) == 0 ) {
219 app.undoCB(NULL, NULL);
220 } else if( strcmp(item->label(), "&Preferences...") == 0 ) {
221 app.AppMenuPreferencesCB(NULL, NULL);
222 } else if( strcmp(item->label(), "&Copy") == 0 ) {
223 app.copySelection();
224 } else if( strcmp(item->label(), "&Paste") == 0 ) {
225 app.paste();
226 } else if( strcmp(item->label(), "&Paste with format ...") == 0 ) {
227 app.paste(true, false);
228 } else if( strcmp(item->label(), "&Paste into Selection") == 0 ) {
229 app.paste(true, true);
230 } else if( strcmp(item->label(), "&Edit cell ...") == 0 ) {
231 app.editSingleCellCB(NULL, NULL);
232 } else if( strcmp(item->label(), "&Move Column(s) Left") == 0 ) {
233 app.moveCols(false);
234 } else if( strcmp(item->label(), "&Move Column(s) Right") == 0 ) {
235 app.moveCols(true);
236 } else if( strcmp(item->label(), "&Insert Row Below") == 0 ) {
237 app.addRow(false);
238 } else if( strcmp(item->label(), "&Insert Row Above") == 0 ) {
239 app.addRow(true);
240 } else if( strcmp(item->label(), "&Insert Column Right") == 0 ) {
241 app.addCol(false);
242 } else if( strcmp(item->label(), "&Insert Column Left") == 0 ) {
243 app.addCol(true);
244 } else if( strcmp(item->label(), "&Delete Row(s)") == 0 ) {

Callers

nothing calls this directly

Calls 15

createNewWindowMethod · 0.80
openFileMethod · 0.80
saveFileCBMethod · 0.80
saveFileAsCBMethod · 0.80
splitCsvCBMethod · 0.80
exportJsonCBMethod · 0.80
closeWindowMethod · 0.80
setCsvPropertiesCBMethod · 0.80
showInfoWindowCBMethod · 0.80
quitApplicationMethod · 0.80
undoCBMethod · 0.80
AppMenuPreferencesCBMethod · 0.80

Tested by

no test coverage detected