www.digitalmars.com         C & C++   DMDScript  

D - Event (Dig)

reply "Phill" <phill pacific.net.au> writes:
Does anyone know how to get the Object
source of an Event, in Dig. ie:

Button b;

//later on

with(b = new Button("1")){
    onClick(handleEvent());
    }

// later on

handleEvent(Event event){
         //now how do I get the Object source and
         // string from the button from the parameter
     }

I have made a simple calculator with 18 buttons,
at the moment I have a function to handle each buttons
event ie: 18 Event functions.

Code attached.

Phill.



begin 666 DCalc.d
M+R\ *BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BH-"B\O#0HO+R!0<F]J96-T($-R96%T960 ,2 O(#$R("\ ,C P
M- T*+R\ 0W)E871E9"!">2!0:&EL;"!4:&]R<&4-"B\O(%1H:7, <')O9W)A
M;2!I<R!A('9E<GD 8F%S:6, 8V%L8W5L871O<BP =&\ :&5L<"!M92 -"B\O
M9V5T(&%Q=6%I;G1E9"!W:71H($0L($1)1$4 86YD('1H92!$24< 1U5)(&]N
M(&UY(&9I<G-T(&-R87 -"B\O(&%T=&5M<'0 870 =7-I;F< =&AE;2X #0HO
M+U-P96-I86P =&AA;FMS('1O('1H92!P96]P;&4 =&AA="!A;G-W97)E9"!M
M>2!Q=65S=&EO;G, 870 #0HO+VYE=RYD:6=I=&%L;6%R<RYC;VTL(&%N9" -
M"B\O(&1?;&%B0'EA:&]O9W)O=7!S+F-O;0T*+R\ *BHJ*BHJ*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BH-"FEM<&]R="!N
M970N0G5R=&]N4F%D;VYS+F1I9RYM86EN.PT*:6UP;W)T(&YE="Y"=7)T;VY2
M861O;G,N9&EG+F=L.PT*#0II;7!O<G0 <W1D+G-T<FEN9SL-"FEM<&]R="!S
M=&0N8RYS=&1I;SL-" T*#0I"=71T;VX ;VYE+"!T=V\L('1H<F5E+"!F;W5R
M+"!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I.PT*"0D ("  ?0T*"0D-" D)"7=I=&  *&UO9" ](&YE=R!"=71T;VXH
M=&AI<RDI>PT*("  ("  ("  ("  8V%P=&EO;B H(B  )2  (BD[#0H)"0EG
M<FED*" R+ DT+ DQ+" Q*3L-" D)"7-T:6-K>2 B/#Y>=B(I.PT*"0D)8F]R
M9&5R960 *'1R=64I.PT*"0D);VY#;&EC:RYA9&0H)F1O36]D*3L-" D)("  
M('T-" D)#0H)"0EW:71H("AP;'5S(#T ;F5W($)U='1O;BAT:&ES*2E[#0H 
M("  ("  ("  ("!C87!T:6]N(" B(" K(" B*3L-" D)"6=R:60H(#,L"3$L
M"3$L(#$I.PT*"0D)<W1I8VMY*"(\/EYV(BD[#0H)"0EB;W)D97)E9" H=')U
M92D[#0H)"0EO;D-L:6-K+F%D9" F9&]0;'5S*3L-" D)("  ('T-" D)#0H)
M"0EW:71H("AM:6YU<R ](&YE=R!"=71T;VXH=&AI<RDI>PT*("  ("  ("  
M("  8V%P=&EO;B H(B  +2  (BD[#0H)"0EG<FED*" S+ DR+ DQ+" Q*3L-
M" D)"7-T:6-K>2 B/#Y>=B(I.PT*"0D)8F]R9&5R960 *'1R=64I.PT*"0D)
M;VY#;&EC:RYA9&0H)F1O36EN=7,I.PT*"0D ("  ?0T*"0D-" D)"7=I=&  
M*'1I;65S(#T ;F5W($)U='1O;BAT:&ES*2E[#0H ("  ("  ("  ("!C87!T
M:6]N(" B(" J(" B*3L-" D)"6=R:60H(#,L"3,L"3$L(#$I.PT*"0D)<W1I
M8VMY*"(\/EYV(BD[#0H)"0EB;W)D97)E9" H=')U92D[#0H)"0EO;D-L:6-K
M+F%D9" F9&]4:6UE<RD[#0H)"2  ("!]#0H)"0T*"0D)=VET:" H9&EV:61E
M(#T ;F5W($)U='1O;BAT:&ES*2E[#0H ("  ("  ("  ("!C87!T:6]N(" B
M(" O(" B*3L-" D)"6=R:60H(#,L"30L"3$L(#$I.PT*"0D)<W1I8VMY*"(\
M/EYV(BD[#0H)"0EB;W)D97)E9" H=')U92D[#0H)"0EO;D-L:6-K+F%D9" F
M9&]$:79I9&4I.PT*"0D ("  ?0T*"0D-" D)"7=I=&  *&-L<B ](&YE=R!"
M=71T;VXH=&AI<RDI>PT*("  ("  ("  ("  8V%P=&EO;B H(B!#("(I.PT*
M"0D)9W)I9"  ,"P)-2P),BP ,BD[#0H)"0ES=&EC:WDH(CP^(BD[#0H)"0EB
M;W)D97)E9" H=')U92D[#0H)"0EO;D-L:6-K+F%D9" F9&]#;&5A<BD[#0H)
M"2  ("!]#0H)"0T*"0D)=VET:" H97%L(#T ;F5W($)U='1O;BAT:&ES*2E[
M#0H ("  ("  ("  ("!C87!T:6]N(" B(#T (BD[#0H)"0EG<FED*" R+ DU
M+ DR+" R*3L-" D)"7-T:6-K>2 B/#XB*3L-" D)"6]N0VQI8VLN861D*"9D
M;T5Q;"D[#0H)"0EB;W)D97)E9" H=')U92D[#0H)"0D-" D)("  ('T-" D)
M?0T*"0D-" D)#0IV;VED(&1O3VYE("A%=F5N="!E=F5N="E[#0H)#0H)"0EE
M9"YT97AT*&%P<&5N9"AE9"YT97AT*"DL("(Q(BDI.PD)#0H)"0D)( T*("  
M('T)#0H-"G9O:60 9&]4=V\H179E;G0 92E[( T*"0D ("  ("  (&5D+G1E
M>'0H87!P96YD*&5D+G1E>'0H*2P (C(B*2D["0T*"0D)"0T*"0D)"2!]#0H)
M"0D)#0IV;VED(&1O5&AR964H179E;G0 92E[( T*"0D ("  ("  (&5D+G1E
M>'0H87!P96YD*&5D+G1E>'0H*2P (C,B*2D["0T*"0D)"0T*"0D)"2!]#0H-
M"G9O:60 9&]&;W5R*$5V96YT(&4I>R -" D)("  ("  ("!E9"YT97AT*&%P
M<&5N9"AE9"YT97AT*"DL("(T(BDI.PD-" D)"0D-" D)"0D ?0T*#0IV;VED
M(&1O1FEV92A%=F5N="!E*7L #0H)"2  ("  ("  960N=&5X="AA<'!E;F0H
M960N=&5X=" I+" B-2(I*3L)#0H)"0D)#0H)"0D)('T-" D)"0D-"G9O:60 
M9&]3:7 H179E;G0 92E[( T*"0D ("  ("  (&5D+G1E>'0H87!P96YD*&5D
M+G1E>'0H*2P (C8B*2D["0T*"0D)"0T*"0D)"2!]#0H-"G9O:60 9&]3979E
M;BA%=F5N="!E*7L #0H)"2  ("  ("  960N=&5X="AA<'!E;F0H960N=&5X
M=" I+" B-R(I*3L)#0H)"0D)#0H)"0D)('T-" D)"0D-"G9O:60 9&]%:6=H
M="A%=F5N="!E*7L #0H)"2  ("  ("  960N=&5X="AA<'!E;F0H960N=&5X
M=" I+" B."(I*3L)#0H)"0D)#0H)"0D)('T-" D)"0D-"G9O:60 9&].:6YE
M*$5V96YT(&4I>R -" D)("  ("  ("!E9"YT97AT*&%P<&5N9"AE9"YT97AT
M*"DL("(Y(BDI.PD-" D)"0D-" D)"0D ?0T*"0D)"0T*=F]I9"!D;UIE<F\H
M179E;G0 92E[( T*"0D ("  ("  (&5D+G1E>'0H87!P96YD*&5D+G1E>'0H
M*2P (C B*2D["0T*"0D)"0T*"0D)"2!]#0H)"0D)#0IV;VED(&1O4&5R:6]D
M*$5V96YT(&4I>R -" D)("  ("  ("!E9"YT97AT*&%P<&5N9"AE9"YT97AT
M*"DL("(N(BDI.PD-" D)"0D-" D)"0D ?0T*"0D)"0T*=F]I9"!D;TUO9" I
M>R -" ED;T-L96%R*"D[#0H):68H9FER<W0 /3T =')U92E[( T*"0EF:7)S
M=" ](&9A;'-E.PT*"0EF:7)S=$YU;6)E<B ](&%T;V8H960N=&5X=" I*3L-
M" D)?0T*"6]P(#T (B4B.PT*"2!]"0D-" D-"G9O:60 9&]0;'5S*"E[( T*
M"69I<G-T(#T 9F%L<V4[#0H);W  /2 B*R([#0H)9FER<W1.=6UB97( /2!A
M=&]F*&5D+G1E>'0H*2D[#0H)<')I;G1F*")F:7)S=$YU;6)E<CTB*3L-" EP
M<FEN=&8H(B5F(BP 9FER<W1.=6UB97(I.PT*"7!R:6YT9B B7&XB*3L-" ED
M;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QA>5)E
M<W5L=" I(#L-" D)('T-" EE;'-E#0H):68H;W  /3T (BTB*7L #0H)"7)E
M<W5L=" ](&9I<G-T3G5M8F5R("T <V5C;VYD3G5M8F5R.PT*"0ED:7-P;&%Y
M4F5S=6QT*"D .PT*"0E]( T*"65L<V4-" EI9BAO<" ]/2 B*B(I>R -" D)
M<F5S=6QT(#T 9FER<W1.=6UB97( *B!S96-O;F1.=6UB97([#0H)"61I<W!L
M87E297-U;'0H*2 [#0H)"2!]#0H)96QS90T*"6EF*&]P(#T]("(O(BE[( T*
M"0ER97-U;'0 /2!F:7)S=$YU;6)E<B O('-E8V]N9$YU;6)E<CL-" D)9&ES
M<&QA>5)E<W5L=" I(#L-" D)?0T*"65L<V4-" EI9BAO<" ]/2 B)2(I>R -
M" D)<F5S=6QT(#T 9FER<W1.=6UB97( )2!S96-O;F1.=6UB97([#0H)"61I
M<W!L87E297-U;'0H*2 [#0H)"2!]#0H)96QS90T*"0D (&5D+G1E>'0H(DY/
M($]015)!5$]2(%-014-)1DE%1"(I.PT*"0D-"GT-" T*=F]I9"!D:7-P;&%Y
M4F5S=6QT*"E[( T*"6-H87( 8VA;,3 Q73L-"B  ("!S<')I;G1F*&-H+" B
M)4<B+"!R97-U;'0I.PT*"65D+G1E>'0H8V I.PT*"2!]"0D)"0T*"0T*8VAA
M<EM=(&%P<&5N9"AC:&%R6UT =&]!<'!E;F0L(&-H87);72!V86QU92E[#0H)
M#0H)"0ER971U<FX <W1D+G-T<FEN9RYT;U-T<FEN9RAS=')C870H=&]!<'!E
M;F0L('9A;'5E*2D[#0H)"0D-" D)?0T*"0T*"0D-"B!]#0H-" T*(" -"B  
M=F]I9"!M86EN(" I#0H ('L-"B  ("  *&YE=R!D8V%L8W9I97<I+G-H;W=-
1;V1A;" H*3L-"B  ?0T*#0H`
`
end
Jan 23 2004
parent reply Burton Radons <loth users.sourceforge.net> writes:
Phill wrote:
 Does anyone know how to get the Object
 source of an Event, in Dig. ie:
 
 Button b;
 
 //later on
 
 with(b = new Button("1")){
     onClick(handleEvent());
     }
 
 // later on
 
 handleEvent(Event event){
          //now how do I get the Object source and
          // string from the button from the parameter
      }
 
 I have made a simple calculator with 18 buttons,
 at the moment I have a function to handle each buttons
 event ie: 18 Event functions.
 
 Code attached.
I'm afraid that while that was always in the plan, I never got around to it. However, it's easy to do what you want in this case. Just have something like this: class AppendFunction { char [] text; /**< Text to append. */ this (char [] text) { this.text = text; } void event (Event event) { ed.text (append (ed.text (), text)); } } void doView () { int c, r = 1; void createNumericButton (char [] text) { with (new Button (this)) { caption (" &" ~ text ~ " "); grid (c ++, r, 1, 1); sticky ("<>^v"); bordered (true); onClick.add (&(new AppendFunction (text)).event); } } void nextRow () { c = 0, r ++; } createNumericButton ("1"); createNumericButton ("2"); createNumericButton ("3"); nextRow (); createNumericButton ("5"); createNumericButton ("6"); createNumericButton ("7"); nextRow (); createNumericButton ("8"); createNumericButton ("9"); createNumericButton ("0"); nextRow (); ... }
Jan 25 2004
parent "Phill" <phill pacific.net.au> writes:
Thanks Burton!

That works great, it will also be a great help in
the future.

Phill.


"Burton Radons" <loth users.sourceforge.net> wrote in message
news:buvvru$1l98$1 digitaldaemon.com...
 Phill wrote:
 Does anyone know how to get the Object
 source of an Event, in Dig. ie:

 Button b;

 //later on

 with(b = new Button("1")){
     onClick(handleEvent());
     }

 // later on

 handleEvent(Event event){
          //now how do I get the Object source and
          // string from the button from the parameter
      }

 I have made a simple calculator with 18 buttons,
 at the moment I have a function to handle each buttons
 event ie: 18 Event functions.

 Code attached.
I'm afraid that while that was always in the plan, I never got around to
it.
 However, it's easy to do what you want in this case.  Just have
 something like this:

     class AppendFunction
     {
         char [] text; /**< Text to append. */

         this (char [] text)
         {
             this.text = text;
         }

         void event (Event event)
         {
             ed.text (append (ed.text (), text));
         }
     }

     void doView ()
     {
        int c, r = 1;

        void createNumericButton (char [] text)
        {
           with (new Button (this))
           {
              caption (" &" ~ text ~ " ");
              grid (c ++, r, 1, 1);
              sticky ("<>^v");
              bordered (true);
              onClick.add (&(new AppendFunction (text)).event);
           }
        }

        void nextRow ()
        {
           c = 0, r ++;
        }

        createNumericButton ("1");
        createNumericButton ("2");
        createNumericButton ("3");
        nextRow ();
        createNumericButton ("5");
        createNumericButton ("6");
        createNumericButton ("7");
        nextRow ();
        createNumericButton ("8");
        createNumericButton ("9");
        createNumericButton ("0");
        nextRow ();
        ...
     }
Jan 25 2004