Batch #10192 by ragnarok-clanker: forced by an admin (20 lower score(s), 81 changed function(s)); checked with 87 compiled unit(s), including every includer of Source/UI/CashShop/UICashShopWnd.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Dialogs/UIEditctrlWnd.h, Source/UI/Dialogs/UIEmailAddressWnd.h, Source/UI/Dialogs/UIGraffiStrboxWnd.h, Source/UI/Dialogs/UINpcEditDialogWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Dialogs/UIProhibitListWnd.h, Source/UI/Dialogs/UITipboxWnd.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIEditCtrl_Currency.h, Source/UI/Guild/UIGuildHelperWnd.h, Source/UI/Lists/UITreeView.h, Source/UI/Party/UIAdvenPartyBoardWnd.h, Source/UI/Party/UIPartySettingWnd.h, Source/UI/Party/UIRegisterPartyWnd.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIReputeWnd.h, Source/UI/Window/UIAccountLimitedToolWnd.h, Source/UI/Window/UIBank_NewWnd.h, Source/UI/Window/UIChatRoomWnd.h, Source/UI/Window/UICntWnd.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UILoginOTPWnd.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UINewMakeCharWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIReplayRECControlWnd.h, Source/UI/Window/UISeekPartyListWnd.h, Source/UI/Window/UISeekPartyMBWnd.h, Source/UI/Window/UISerachStoreInfoWnd.h, Source/UI/Window/UITalkboxTrapInputWnd.h.
101 lines
3.1 KiB
C++
101 lines
3.1 KiB
C++
#ifndef RAGNAROK_SOURCE_UI_EDIT_UIEDITBOXEX_H
|
|
#define RAGNAROK_SOURCE_UI_EDIT_UIEDITBOXEX_H
|
|
|
|
#include "UI/Edit/UIEditCtrl.h"
|
|
#include "UI/Window/UIControl.h"
|
|
|
|
#include <chrono>
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <functional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
struct EditLine {
|
|
/* 0000 */ std::string text;
|
|
/* 0018 */ unsigned char unknown_0018;
|
|
/* 001C */ int selectionBegin;
|
|
/* 0020 */ int selectionEnd;
|
|
};
|
|
|
|
class CUIEditCtrlEx : public UIEditCtrl3 {
|
|
public:
|
|
CUIEditCtrlEx(UIWindowContext& windows);
|
|
void Paint() override;
|
|
void Invalidate() override;
|
|
void SelectAll() override;
|
|
void SetText(const char* value) override;
|
|
void Synchronize() override;
|
|
void UpdateScrollBar() override;
|
|
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
|
|
|
|
void sub_860C60(std::vector<std::string>* lines);
|
|
|
|
void RefreshPlaceholder();
|
|
void HandleKeyDown(int key, std::intptr_t lparam);
|
|
void ResetDragState();
|
|
void DrawCaret(int x, int y);
|
|
void PaintTextLines();
|
|
int LeadingBytesFitting(const std::string& text, int width);
|
|
int TrailingOffsetFitting(const std::string& text, int width);
|
|
|
|
/* 0188 */ std::uint32_t normalColor;
|
|
/* 018C */ int unknown_018C;
|
|
/* 0190 */ unsigned char unknown_0190;
|
|
/* 0194 */ std::string placeholder;
|
|
/* 01AC */ std::uint32_t placeholderColor;
|
|
/* 01B0 */ int alignment;
|
|
/* 01B4 */ int unknown_01B4;
|
|
/* 01B8 */ int verticalPadding;
|
|
/* 01BC */ std::vector<EditLine> lines;
|
|
/* 01C8 */ unsigned char selectedAll;
|
|
/* 01CC */ int column;
|
|
/* 01D0 */ int line;
|
|
/* 01D4 */ int unknown_01D4;
|
|
/* 01D8 */ int unknown_01D8;
|
|
/* 01DC */ unsigned char unknown_01DC;
|
|
/* 01E0 */ std::chrono::system_clock::time_point caretStart;
|
|
/* 01E8 */ int scrollMaximum;
|
|
/* 01EC */ int visibleLines;
|
|
/* 01F0 */ int unknown_01F0;
|
|
/* 01F4 */ int scrollPosition;
|
|
/* 01F8 */ int unknown_01F8;
|
|
};
|
|
|
|
class CUIEditBoxEx : public CUIControl {
|
|
public:
|
|
explicit CUIEditBoxEx(UIWindowContext& context);
|
|
void Resize(int width, int height) override;
|
|
bool Slot05() override;
|
|
void Paint() override;
|
|
int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override;
|
|
|
|
void Create(int width, int height, bool withScrollBar);
|
|
void ResetSelection();
|
|
void SetCursor(std::size_t position);
|
|
int Length();
|
|
void SetAlignment(int value);
|
|
void SetBackgroundColor(std::uint32_t color);
|
|
void SetTextColor(std::uint32_t color);
|
|
void SetHighlight(int value);
|
|
void SetBorderColor(std::uint32_t color);
|
|
void SetBorderWidth(int width);
|
|
void SetMaximum(int value);
|
|
void SetEditBounds(int left, int top, int right, int bottom);
|
|
void SetMask(char value);
|
|
void SetText(const std::string& text);
|
|
void SetFocus();
|
|
void SetOnSubmit(std::function<void()> handler);
|
|
|
|
/* 0080 */ std::uint32_t backgroundColor;
|
|
/* 0084 */ std::uint32_t borderColor;
|
|
/* 0088 */ int borderWidth;
|
|
/* 008C */ int editLeft;
|
|
/* 0090 */ int editTop;
|
|
/* 0094 */ int editRight;
|
|
/* 0098 */ int editBottom;
|
|
/* 009C */ CUIEditCtrlEx* edit;
|
|
/* 00A0 */ std::function<void()> onSubmit;
|
|
};
|
|
|
|
#endif
|