int EditSetLabel(int ed, char *text);

 

Sets the current edit box's label text.

 

Return Value

 

Return value not used.

 

Parameters

 

ed

Edit box handle.

 

text

Text to be displayed in the edit box when it has no value.

 

Remarks

 

EditSetLabel() will set the gray text to be displayed in the edit box to provide a description of the field.  When a value is entered by the user, this text label will disappear.  Also, when all text is deleted from the edit box, the label text becomes visible again.  This value had no bearing on the value returned by EditGetText(), or the value provided to EditSetText().

 

Availability

 

Available in DragonFireSDK 1.2 and later.

 

Example

 

#include "DragonFireSDK.h"

#include <string.h>

 

int edit;

 

int OnEditDone()

{

  char EditText[100];

 

   EditGetText(edit, EditText);

 

  if (strcmp(EditText, "foo") == 0)

   {

       EditSetText(edit, "bar");

   }

 

  if (strcmp(EditText, "bye") == 0)

   {

       EditSetVisible(edit, 0);

   }

 

  return(0);

}

 

void AppMain()

{

   ViewAdd("MyForm.png",0,0); // display a form background with white edit boxes

   edit = EditAdd(10, 80, 50);

   EditSetLabel(edit, "Email");

   EditSetOnDone(OnEditDone);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}