[Solved]Unresolved identifier

General help with the Ecere Cross Platform GUI toolkit: Window, common controls, events, etc.
Help with the 2D Graphics library: Surface, Display, Bitmap, Font and others.
Post Reply
samsam598
Posts: 212
Joined: Thu Apr 14, 2011 9:44 pm

[Solved]Unresolved identifier

Post by samsam598 »

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);
      }
   }
 
   }          
 
Last edited by samsam598 on Tue Aug 27, 2013 5:32 am, edited 1 time in total.
redj
Posts: 105
Joined: Sun Jan 17, 2010 10:03 am

Re: Unresolved identifier

Post by redj »

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
samsam598
Posts: 212
Joined: Thu Apr 14, 2011 9:44 pm

Re: Unresolved identifier

Post by samsam598 »

Hi redj,

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

Cheers,
Sam
Post Reply