Ecere SDK/eC Forums
http://ecere.org/community/
Print view

[Solved]Unresolved identifier
http://ecere.org/community/viewtopic.php?f=5&t=370
Page 1 of 1
Author:  samsam598 [ Tue Aug 27, 2013 2:36 am ]
Post subject:  [Solved]Unresolved identifier

Greetings!

Sorry...but why?

Code: Select all

Compiling...
form1.ec
   form1.ec:53:10: error: unresolved identifier txtWebContent
   form1.ec:53:10: error: member operator on non-structure type expression txtWebContent.Clear
   form1.ec:58:10: error: unresolved identifier txtWeb
   form1.ec:58:10: error: member operator on non-structure type expression txtWeb.Clear          
ec source file:

Code: Select all

 
 import "ecere"
class Form1 : Window
{
   caption = "Read Net File";
   background = formColor;
   borderStyle = fixed;
   hasMaximize = true;
   hasMinimize = true;
   hasClose = true;
   size = { 528, 372 };
   anchor = { horz = -28, vert = -24 };
 
   Label label1 { this, caption = "Which Website:", size = { 84, 21 }, position = { 16, 24 } };
   EditBox txtWebContent 
   {      
      this, caption = "editBox1", anchor = { left = 8, top = 56, right = 10, bottom = 13 }, hasHorzScroll = true, true, readOnly = true, true;
 
 
   };
   EditBox txtWeb 
   {
      this, size = { 410, 21 }, anchor = { left = 94, top = 24, right = 18 }, contents = "http://www.yahoo.com.cn";
 
      bool OnKeyDown(Key key, unichar ch)
      {
         txtWebContent.Clear();//----------->>>!!
         txtWeb.Clear();           //----------->>>!!
         return EditBox::OnKeyDown(key, ch);
      }
   }
 
   }          
 
Author:  redj [ Tue Aug 27, 2013 4:19 am ]
Post subject:  Re: Unresolved identifier

hey samsam598,

Use NotifyKeyDown, which you will use to do something in the event of a keystroke when using any GUI control/widget that implements NotifyKeyDown, instead of the OnKeyDown, which is something you would use to implement the specifics of a custom GUI control/widget.

The Notify* methods will usually have this as the master Window like you're trying to do in your code. The On* on the other hand will have this point to the control itself. The txtWeb instance in this case.

I hope this helps... cheers!

-redj
Author:  samsam598 [ Tue Aug 27, 2013 5:09 am ]
Post subject:  Re: Unresolved identifier

Hi redj,

It really helps...and the issue's fixed.Thank you!

Cheers,
Sam
All times are UTC-05:00 Page 1 of 1