int NoteAdd(int x, int y, int width, int height);
Add a multi-line edit box of the specified size at the coordinates specified.
Return Value
Returns an int handle to the edit object.
Parameters
x X coordinate.
y Y coordinate.
width Width of the note.
height Height of the note.
Remarks
NoteAdd() creates a multi-line edit box on the screen at the specified coordinates and of specified size.
Availability
Available in DragonFireSDK 2.0 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() {
} |