Mercurial > octave
comparison src/graphics.h.in @ 7364:0e07f78369d1
[project @ 2008-01-12 08:38:17 by jwe]
author | jwe |
---|---|
date | Sat, 12 Jan 2008 08:38:17 +0000 |
parents | c31e5dab4f85 |
children | f5e801eee0d1 |
comparison
equal
deleted
inserted
replaced
7363:c31e5dab4f85 | 7364:0e07f78369d1 |
---|---|
212 | 212 |
213 bool is_hidden (void) const { return hidden; } | 213 bool is_hidden (void) const { return hidden; } |
214 | 214 |
215 void set_hidden (bool flag) { hidden = flag; } | 215 void set_hidden (bool flag) { hidden = flag; } |
216 | 216 |
217 virtual void set (const octave_value& val) | 217 virtual void set (const octave_value&) |
218 { error ("set: invalid property \"%s\"", name.c_str ()); } | 218 { error ("set: invalid property \"%s\"", name.c_str ()); } |
219 | 219 |
220 virtual octave_value get (void) const | 220 virtual octave_value get (void) const |
221 { | 221 { |
222 error ("get: invalid property \"%s\"", name.c_str ()); | 222 error ("get: invalid property \"%s\"", name.c_str ()); |
320 }; | 320 }; |
321 | 321 |
322 class radio_property : public base_property | 322 class radio_property : public base_property |
323 { | 323 { |
324 public: | 324 public: |
325 radio_property (const std::string& name, const graphics_handle& h, | 325 radio_property (const std::string& nm, const graphics_handle& h, |
326 const radio_values& v = radio_values ()) | 326 const radio_values& v = radio_values ()) |
327 : base_property (name, h), | 327 : base_property (nm, h), |
328 vals (v), current_val (v.default_value ()) { } | 328 vals (v), current_val (v.default_value ()) { } |
329 | 329 |
330 radio_property (const std::string& name, const graphics_handle& h, | 330 radio_property (const std::string& nm, const graphics_handle& h, |
331 const std::string& v) | 331 const std::string& v) |
332 : base_property (name, h), | 332 : base_property (nm, h), |
333 vals (v), current_val (vals.default_value ()) { } | 333 vals (v), current_val (vals.default_value ()) { } |
334 | 334 |
335 radio_property (const std::string& name, const graphics_handle& h, | 335 radio_property (const std::string& nm, const graphics_handle& h, |
336 const radio_values& v, const std::string& def) | 336 const radio_values& v, const std::string& def) |
337 : base_property (name, h), | 337 : base_property (nm, h), |
338 vals (v), current_val (def) { } | 338 vals (v), current_val (def) { } |
339 | 339 |
340 radio_property (const radio_property& p) | 340 radio_property (const radio_property& p) |
341 : base_property (p), vals (p.vals), current_val (p.current_val) { } | 341 : base_property (p), vals (p.vals), current_val (p.current_val) { } |
342 | 342 |
437 : base_property ("", graphics_handle ()), | 437 : base_property ("", graphics_handle ()), |
438 current_type (color_t), color_val (c), radio_val (v), | 438 current_type (color_t), color_val (c), radio_val (v), |
439 current_val (v.default_value ()) | 439 current_val (v.default_value ()) |
440 { } | 440 { } |
441 | 441 |
442 color_property (const std::string& name, const graphics_handle& h, | 442 color_property (const std::string& nm, const graphics_handle& h, |
443 const color_values& c = color_values (), | 443 const color_values& c = color_values (), |
444 const radio_values& v = radio_values ()) | 444 const radio_values& v = radio_values ()) |
445 : base_property (name, h), | 445 : base_property (nm, h), |
446 current_type (color_t), color_val (c), radio_val (v), | 446 current_type (color_t), color_val (c), radio_val (v), |
447 current_val (v.default_value ()) | 447 current_val (v.default_value ()) |
448 { } | 448 { } |
449 | 449 |
450 color_property (const std::string& name, const graphics_handle& h, | 450 color_property (const std::string& nm, const graphics_handle& h, |
451 const radio_values& v) | 451 const radio_values& v) |
452 : base_property (name, h), | 452 : base_property (nm, h), |
453 current_type (radio_t), color_val (color_values ()), radio_val (v), | 453 current_type (radio_t), color_val (color_values ()), radio_val (v), |
454 current_val (v.default_value ()) | 454 current_val (v.default_value ()) |
455 { } | 455 { } |
456 | 456 |
457 color_property (const std::string& name, const graphics_handle& h, | 457 color_property (const std::string& nm, const graphics_handle& h, |
458 const std::string& v) | 458 const std::string& v) |
459 : base_property (name, h), | 459 : base_property (nm, h), |
460 current_type (radio_t), color_val (color_values ()), radio_val (v), | 460 current_type (radio_t), color_val (color_values ()), radio_val (v), |
461 current_val (radio_val.default_value ()) | 461 current_val (radio_val.default_value ()) |
462 { } | 462 { } |
463 | 463 |
464 color_property (const std::string& name, const graphics_handle& h, | 464 color_property (const std::string& nm, const graphics_handle& h, |
465 const color_property& v) | 465 const color_property& v) |
466 : base_property (name, h), | 466 : base_property (nm, h), |
467 current_type (v.current_type), color_val (v.color_val), | 467 current_type (v.current_type), color_val (v.color_val), |
468 radio_val (v.radio_val), current_val (v.current_val) | 468 radio_val (v.radio_val), current_val (v.current_val) |
469 { } | 469 { } |
470 | 470 |
471 color_property (const color_property& p) | 471 color_property (const color_property& p) |
524 // --------------------------------------------------------------------- | 524 // --------------------------------------------------------------------- |
525 | 525 |
526 class double_property : public base_property | 526 class double_property : public base_property |
527 { | 527 { |
528 public: | 528 public: |
529 double_property (const std::string& name, const graphics_handle& h, | 529 double_property (const std::string& nm, const graphics_handle& h, |
530 double d = 0) | 530 double d = 0) |
531 : base_property (name, h), | 531 : base_property (nm, h), |
532 current_val (d) { } | 532 current_val (d) { } |
533 | 533 |
534 double_property (const double_property& p) | 534 double_property (const double_property& p) |
535 : base_property (p), current_val (p.current_val) { } | 535 : base_property (p), current_val (p.current_val) { } |
536 | 536 |
560 // --------------------------------------------------------------------- | 560 // --------------------------------------------------------------------- |
561 | 561 |
562 class array_property : public base_property | 562 class array_property : public base_property |
563 { | 563 { |
564 public: | 564 public: |
565 array_property (const std::string& name, const graphics_handle& h, | 565 array_property (const std::string& nm, const graphics_handle& h, |
566 const octave_value& m) | 566 const octave_value& m) |
567 : base_property (), data (m) { } | 567 : base_property (nm, h), data (m) { } |
568 | 568 |
569 octave_value get (void) const { return data; } | 569 octave_value get (void) const { return data; } |
570 | 570 |
571 void set (const octave_value& v) | 571 void set (const octave_value& v) |
572 { | 572 { |
604 { | 604 { |
605 public: | 605 public: |
606 data_property (void) | 606 data_property (void) |
607 : base_property ("", graphics_handle ()) { } | 607 : base_property ("", graphics_handle ()) { } |
608 | 608 |
609 data_property (const std::string& name, const graphics_handle& h, | 609 data_property (const std::string& nm, const graphics_handle& h, |
610 const NDArray& m = NDArray ()) | 610 const NDArray& m = NDArray ()) |
611 : base_property (name, h), | 611 : base_property (nm, h), |
612 data (m), xmin (octave_Inf), xmax (-octave_Inf), xminp (octave_Inf) | 612 data (m), xmin (octave_Inf), xmax (-octave_Inf), xminp (octave_Inf) |
613 { | 613 { |
614 get_data_limits (); | 614 get_data_limits (); |
615 } | 615 } |
616 | 616 |
617 data_property (const std::string& name, const graphics_handle& h, | 617 data_property (const std::string& nm, const graphics_handle& h, |
618 const Matrix& m) | 618 const Matrix& m) |
619 : base_property (name, h), | 619 : base_property (nm, h), |
620 data (m), xmin (octave_Inf), xmax (-octave_Inf), xminp (octave_Inf) | 620 data (m), xmin (octave_Inf), xmax (-octave_Inf), xminp (octave_Inf) |
621 { | 621 { |
622 get_data_limits (); | 622 get_data_limits (); |
623 } | 623 } |
624 | 624 |
686 // --------------------------------------------------------------------- | 686 // --------------------------------------------------------------------- |
687 | 687 |
688 class bool_property : public radio_property | 688 class bool_property : public radio_property |
689 { | 689 { |
690 public: | 690 public: |
691 bool_property (const std::string& name, const graphics_handle& h, | 691 bool_property (const std::string& nm, const graphics_handle& h, |
692 bool val) | 692 bool val) |
693 : radio_property (name, h, radio_values (val ? "{on}|off" : "on|{off}")) | 693 : radio_property (nm, h, radio_values (val ? "{on}|off" : "on|{off}")) |
694 { } | 694 { } |
695 | 695 |
696 bool_property (const std::string& name, const graphics_handle& h, | 696 bool_property (const std::string& nm, const graphics_handle& h, |
697 const char* val) | 697 const char* val) |
698 : radio_property (name, h, radio_values ("on|off"), val) | 698 : radio_property (nm, h, radio_values ("on|off"), val) |
699 { } | 699 { } |
700 | 700 |
701 bool_property (const bool_property& p) | 701 bool_property (const bool_property& p) |
702 : radio_property (p) { } | 702 : radio_property (p) { } |
703 | 703 |
721 // --------------------------------------------------------------------- | 721 // --------------------------------------------------------------------- |
722 | 722 |
723 class handle_property : public base_property | 723 class handle_property : public base_property |
724 { | 724 { |
725 public: | 725 public: |
726 handle_property (const std::string& name, const graphics_handle& h, | 726 handle_property (const std::string& nm, const graphics_handle& h, |
727 const graphics_handle& val = graphics_handle ()) | 727 const graphics_handle& val = graphics_handle ()) |
728 : base_property (name, h), | 728 : base_property (nm, h), |
729 current_val (val) { } | 729 current_val (val) { } |
730 | 730 |
731 handle_property (const handle_property& p) | 731 handle_property (const handle_property& p) |
732 : base_property (p), current_val (p.current_val) { } | 732 : base_property (p), current_val (p.current_val) { } |
733 | 733 |
756 // --------------------------------------------------------------------- | 756 // --------------------------------------------------------------------- |
757 | 757 |
758 class any_property : public base_property | 758 class any_property : public base_property |
759 { | 759 { |
760 public: | 760 public: |
761 any_property (const std::string& name, const graphics_handle& h, | 761 any_property (const std::string& nm, const graphics_handle& h, |
762 const octave_value& m = Matrix ()) | 762 const octave_value& m = Matrix ()) |
763 : base_property (), data (m) { } | 763 : base_property (nm, h), data (m) { } |
764 | 764 |
765 octave_value get (void) const { return data; } | 765 octave_value get (void) const { return data; } |
766 | 766 |
767 void set (const octave_value& v) { data = v; } | 767 void set (const octave_value& v) { data = v; } |
768 | 768 |
779 // --------------------------------------------------------------------- | 779 // --------------------------------------------------------------------- |
780 | 780 |
781 class callback_property : public base_property | 781 class callback_property : public base_property |
782 { | 782 { |
783 public: | 783 public: |
784 callback_property (const std::string& name, const graphics_handle& h, | 784 callback_property (const std::string& nm, const graphics_handle& h, |
785 const octave_value& m) | 785 const octave_value& m) |
786 : base_property (), callback (m) { } | 786 : base_property (nm, h), callback (m) { } |
787 | 787 |
788 octave_value get (void) const { return callback; } | 788 octave_value get (void) const { return callback; } |
789 | 789 |
790 void set (const octave_value& v) | 790 void set (const octave_value& v) |
791 { | 791 { |