Example #1
0
Surface *Surface::newDialog(uint16 width, const char *line, int color) {
	char **lines;
	Common::String lineCopy(line);
	uint8 numLines;
	wordWrap(lineCopy.begin(), width - (Surface::textX() * 2), lines, numLines);

	// Create the dialog
	Surface *result = newDialog(width, numLines, const_cast<const char **>(lines), true, color);

	// Deallocate used resources
	free(lines);

	return result;
}
Example #2
0
	virtual status_t ReadLine(const BString& line)
	{
		if (fInvoker == NULL)
			return B_OK;

		BMessage messageCopy(*fInvoker->Message());

		BString lineCopy(line);
		lineCopy.RemoveLast("\n");

		messageCopy.AddString("line", lineCopy);

		fInvoker->Invoke(&messageCopy);

		return B_OK;
	}