///////////////////// Text Box /////////////////////
| 415 | // Text Box |
| 416 | ////////////////////////// |
| 417 | TextBox::TextBox(rect_t bounds, bool multiline) : Widget(bounds) { |
| 418 | this->multiline = multiline; |
| 419 | font = Graphics::GetFont("default"); |
| 420 | contents.push_back(std::string()); |
| 421 | |
| 422 | { |
| 423 | ContextMenuEntry ctx; |
| 424 | ctx.id = TextboxCommandCut; |
| 425 | ctx.name = "Cut"; |
| 426 | |
| 427 | ctxEntries.push_back(ctx); |
| 428 | } |
| 429 | |
| 430 | { |
| 431 | ContextMenuEntry ctx; |
| 432 | ctx.id = TextboxCommandCopy; |
| 433 | ctx.name = "Copy"; |
| 434 | |
| 435 | ctxEntries.push_back(ctx); |
| 436 | } |
| 437 | |
| 438 | { |
| 439 | ContextMenuEntry ctx; |
| 440 | ctx.id = TextboxCommandPaste; |
| 441 | ctx.name = "Paste"; |
| 442 | |
| 443 | ctxEntries.push_back(ctx); |
| 444 | } |
| 445 | |
| 446 | { |
| 447 | ContextMenuEntry ctx; |
| 448 | ctx.id = TextboxCommandDelete; |
| 449 | ctx.name = "Delete"; |
| 450 | |
| 451 | ctxEntries.push_back(ctx); |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | void TextBox::Paint(surface_t* surface){ |
| 456 | Graphics::DrawRect(fixedBounds.pos.x + 1, fixedBounds.pos.y + 1, fixedBounds.size.x - 2, fixedBounds.size.y - 2, colours[Colour::ContentBackground], surface); |