41 lines
1.0 KiB
C++
41 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "page.h"
|
|
#include "text_cache.h"
|
|
#include <SDL3_ttf/SDL_ttf.h>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class DateFormatPage : public Page {
|
|
public:
|
|
void onPush(AppState& state) override;
|
|
void onResume(AppState& state) override;
|
|
void onPause(AppState& state) override;
|
|
void onPop(AppState& state) override;
|
|
void handleEvent(const SDL_Event& event) override;
|
|
void update(float dt) override;
|
|
void render(SDL_Renderer* renderer) override;
|
|
|
|
private:
|
|
void createFonts();
|
|
void destroyFonts();
|
|
void destroyTextures();
|
|
|
|
AppState* state_ = nullptr;
|
|
std::string currentFormat_; // saved strftime pattern
|
|
int selectedIndex_ = 0;
|
|
std::string statusMessage_;
|
|
|
|
TTF_Font* fontTitle_ = nullptr;
|
|
TTF_Font* fontHeader_ = nullptr;
|
|
TTF_Font* fontBody_ = nullptr;
|
|
TTF_Font* fontSmall_ = nullptr;
|
|
|
|
CachedText titleText_;
|
|
CachedText currentText_;
|
|
CachedText statusText_;
|
|
CachedText hintText_;
|
|
std::vector<CachedText> nameRows_;
|
|
std::vector<CachedText> sampleRows_;
|
|
};
|