gui.cpp

changeset 38
20f5eaae8425
parent 32
5d22b7ecf110
child 39
110669124caf
equal deleted inserted replaced
37:a413d389b634 38:20f5eaae8425
118 qAct_paste->setShortcut (Qt::CTRL | Qt::Key_V); 118 qAct_paste->setShortcut (Qt::CTRL | Qt::Key_V);
119 119
120 // things not implemented yet 120 // things not implemented yet
121 QAction* qaDisabledActions[] = { 121 QAction* qaDisabledActions[] = {
122 qAct_newSubfile, 122 qAct_newSubfile,
123 qAct_newTriangle,
124 qAct_newQuad,
125 qAct_newCondLine,
126 qAct_newComment,
127 qAct_newVector, 123 qAct_newVector,
128 qAct_newVertex, 124 qAct_newVertex,
129 qAct_cut, 125 qAct_cut,
130 qAct_copy, 126 qAct_copy,
131 qAct_paste, 127 qAct_paste,
276 272
277 } 273 }
278 274
279 void ForgeWindow::slot_newLine () { 275 void ForgeWindow::slot_newLine () {
280 LDLine* line = new LDLine; 276 LDLine* line = new LDLine;
281 const ulong ulSpot = getInsertionPoint ();
282 277
283 memset (line->vaCoords, 0, sizeof line->vaCoords); 278 memset (line->vaCoords, 0, sizeof line->vaCoords);
284 line->dColor = 24; 279 line->dColor = 24;
285 280
286 g_CurrentFile->objects.insert (g_CurrentFile->objects.begin() + ulSpot, line); 281 g_CurrentFile->addObject (line);
287 282 refresh ();
288 buildObjList ();
289 R->hardRefresh ();
290 } 283 }
291 284
292 void ForgeWindow::slot_newTriangle () { 285 void ForgeWindow::slot_newTriangle () {
293 286 LDTriangle* tri = new LDTriangle;
287
288 memset (tri->vaCoords, 0, sizeof tri->vaCoords);
289 tri->dColor = 16;
290
291 g_CurrentFile->addObject (tri);
292 refresh ();
294 } 293 }
295 294
296 void ForgeWindow::slot_newQuad () { 295 void ForgeWindow::slot_newQuad () {
297 296 LDQuad* quad = new LDQuad;
297
298 memset (quad->vaCoords, 0, sizeof quad->vaCoords);
299 quad->dColor = 16;
300
301 g_CurrentFile->addObject (quad);
302 refresh ();
298 } 303 }
299 304
300 void ForgeWindow::slot_newCondLine () { 305 void ForgeWindow::slot_newCondLine () {
301 306 LDCondLine* line = new LDCondLine;
307
308 memset (line->vaCoords, 0, sizeof line->vaCoords);
309 memset (line->vaControl, 0, sizeof line->vaControl);
310 line->dColor = 24;
311
312 g_CurrentFile->addObject (line);
313 refresh ();
302 } 314 }
303 315
304 void ForgeWindow::slot_newComment () { 316 void ForgeWindow::slot_newComment () {
305 317 LDComment* comm = new LDComment;
318 g_CurrentFile->addObject (comm);
319 refresh ();
306 } 320 }
307 321
308 void ForgeWindow::slot_help () { 322 void ForgeWindow::slot_help () {
309 323
310 } 324 }

mercurial