int NoteSetOnDone(int (*callback)(void));

 

Sets the global callback function to be called when a user is finished editing any multi-line edit box.

 

Return Value

 

Return value not used.

 

Parameters

 

callback

Name of the global function to be called when the user has finished editing text.

 

Remarks

 

NoteSetOnDone() will specify the callback function to be called when the user dismisses the note editor. This callback is not associated with any one note - it is called no matter which note finishes typing.

 

Availability

 

Available in DragonFireSDK 1.2 and later.

 

Example

 

#include "DragonFireSDK.h"

 

int BackgroundView;

int MyNote;

bool MyNoteEditable=true;

bool MyNoteVisible=true;

int MyGetTextButton;

int MySetTextButton;

int MySetEditableButton;

int MySetVisibleButton;

char MyTextBuffer[3000];

 

int OnButton(int id)

{

  switch(id)

   {

      case 1:

       NoteGetText(MyNote,MyTextBuffer);

       printf("%s\n",MyTextBuffer);

      break;

      case 2:

       NoteSetText(MyNote,"This is the text\nset from a button.\n");

      break;

      case 3:

       MyNoteEditable=!MyNoteEditable;

       NoteSetEditable(MyNote,MyNoteEditable);

      break;

      case 4:

       MyNoteVisible=!MyNoteVisible;

       NoteSetVisible(MyNote,MyNoteVisible);

      break;

   }

  return(id);

}

 

int OnNoteDone()

{

   printf("Done editing the note!\n");

  return(1);

}

 

void AppMain()

{

   BackgroundView=ViewAdd("Images/Background.png",0,0);

   ViewSetSize(BackgroundView, 320, 200);

   MyNote=NoteAdd(0, 0, 320, 200);

   MyGetTextButton=ButtonAdd("Images/Button", 10, 210, OnButton, 1);

   MySetTextButton=ButtonAdd("Images/Button", 80, 210, OnButton, 2);

   MySetEditableButton=ButtonAdd("Images/Button", 150, 210, OnButton, 3);

   MySetVisibleButton=ButtonAdd("Images/Button", 220, 210, OnButton, 4);

   NoteSetOnDone(OnNoteDone);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}