21 FormFillerAndWindowSetup(GetCPDFSDKAnnotNormal());
24 EXPECT_FALSE(GetCPWLComboBox()->GetText().IsEmpty());
25 EXPECT_STREQ(L"Banana", GetCPWLComboBox()->GetText().c_str());
28 EXPECT_TRUE(GetCPWLComboBox()->GetSelectedText().IsEmpty());
29 GetCPWLComboBox()->SetSelectText();
30 EXPECT_STREQ(L"Banana", GetCPWLComboBox()->GetSelectedText().c_str());
33 GetCPWLComboBox()->SetSelect(0);
34 EXPECT_STREQ(L"Apple", GetCPWLComboBox()->GetSelectedText().c_str());
35 GetCPWLComboBox()->SetSelect(2);
36 EXPECT_STREQ(L"Cherry", GetCPWLComboBox()->GetSelectedText().c_str());
39 EXPECT_FALSE(GetCFFLFormField()->OnChar(GetCPDFSDKAnnotNormal(),
'a', {}));
43 FormFillerAndWindowSetup(GetCPDFSDKAnnotNormal());
44 EXPECT_STREQ(L"Banana", GetCPWLComboBox()->GetText().c_str());
46 GetCPWLComboBox()->SetEditSelection(0, 0);
47 EXPECT_TRUE(GetCPWLComboBox()->GetSelectedText().IsEmpty());
49 GetCPWLComboBox()->SetEditSelection(0, 1);
50 EXPECT_STREQ(L"B", GetCPWLComboBox()->GetSelectedText().c_str());
52 GetCPWLComboBox()->SetEditSelection(0, -1);
53 EXPECT_STREQ(L"Banana", GetCPWLComboBox()->GetSelectedText().c_str());
55 GetCPWLComboBox()->SetEditSelection(-8, -1);
56 EXPECT_TRUE(GetCPWLComboBox()->GetSelectedText().IsEmpty());
58 GetCPWLComboBox()->SetEditSelection(4, 1);
59 EXPECT_STREQ(L"ana", GetCPWLComboBox()->GetSelectedText().c_str());
61 GetCPWLComboBox()->SetEditSelection(1, 4);
62 EXPECT_STREQ(L"ana", GetCPWLComboBox()->GetSelectedText().c_str());
64 GetCPWLComboBox()->SetEditSelection(5, 6);
65 EXPECT_STREQ(L"a", GetCPWLComboBox()->GetSelectedText().c_str());
69 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
70 EXPECT_TRUE(GetCPWLComboBox()->GetText().IsEmpty());
73 EXPECT_TRUE(GetCPWLComboBox()->GetSelectedText().IsEmpty());
74 GetCPWLComboBox()->SetSelect(0);
75 GetCPWLComboBox()->SetSelectText();
76 EXPECT_STREQ(L"Foo", GetCPWLComboBox()->GetSelectedText().c_str());
79 GetCPWLComboBox()->SetSelect(1);
80 EXPECT_STREQ(L"Bar", GetCPWLComboBox()->GetSelectedText().c_str());
81 GetCPWLComboBox()->SetEditSelection(2, 3);
82 EXPECT_STREQ(L"r", GetCPWLComboBox()->GetSelectedText().c_str());
86 GetCFFLFormField()->OnChar(GetCPDFSDKAnnotUserEditable(),
'a', {}));
88 GetCFFLFormField()->OnChar(GetCPDFSDKAnnotUserEditable(),
'b', {}));
90 GetCFFLFormField()->OnChar(GetCPDFSDKAnnotUserEditable(),
'c', {}));
92 EXPECT_TRUE(GetCPWLComboBox()->GetSelectedText().IsEmpty());
93 GetCPWLComboBox()->SetEditSelection(0, 5);
94 EXPECT_STREQ(L"Baabc", GetCPWLComboBox()->GetSelectedText().c_str());
98 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
99 TypeTextIntoTextField(50);
101 GetCPWLComboBox()->SetEditSelection(0, 0);
102 EXPECT_TRUE(GetCPWLComboBox()->GetSelectedText().IsEmpty());
104 GetCPWLComboBox()->SetEditSelection(0, 1);
105 EXPECT_STREQ(L"A", GetCPWLComboBox()->GetSelectedText().c_str());
107 GetCPWLComboBox()->SetEditSelection(0, -1);
108 EXPECT_STREQ(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqr",
109 GetCPWLComboBox()->GetSelectedText().c_str());
111 GetCPWLComboBox()->SetEditSelection(-8, -1);
112 EXPECT_TRUE(GetCPWLComboBox()->GetSelectedText().IsEmpty());
114 GetCPWLComboBox()->SetEditSelection(23, 12);
115 EXPECT_STREQ(L"MNOPQRSTUVW", GetCPWLComboBox()->GetSelectedText().c_str());
117 GetCPWLComboBox()->SetEditSelection(12, 23);
118 EXPECT_STREQ(L"MNOPQRSTUVW", GetCPWLComboBox()->GetSelectedText().c_str());
120 GetCPWLComboBox()->SetEditSelection(49, 50);
121 EXPECT_STREQ(L"r", GetCPWLComboBox()->GetSelectedText().c_str());
123 GetCPWLComboBox()->SetEditSelection(49, 55);
124 EXPECT_STREQ(L"r", GetCPWLComboBox()->GetSelectedText().c_str());
128 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
129 TypeTextIntoTextField(50);
131 GetCPWLComboBox()->SetEditSelection(0, -1);
132 EXPECT_STREQ(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqr",
133 GetCPWLComboBox()->GetSelectedText().c_str());
135 GetCPWLComboBox()->ReplaceSelection(L"");
136 EXPECT_TRUE(GetCPWLComboBox()->GetText().IsEmpty());
140 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
141 TypeTextIntoTextField(50);
143 GetCPWLComboBox()->SetEditSelection(12, 23);
144 EXPECT_STREQ(L"MNOPQRSTUVW", GetCPWLComboBox()->GetSelectedText().c_str());
146 GetCPWLComboBox()->ReplaceSelection(L"");
147 EXPECT_STREQ(L"ABCDEFGHIJKLXYZ[\\]^_`abcdefghijklmnopqr",
148 GetCPWLComboBox()->GetText().c_str());
152 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
153 TypeTextIntoTextField(50);
155 GetCPWLComboBox()->SetEditSelection(0, 5);
156 EXPECT_STREQ(L"ABCDE", GetCPWLComboBox()->GetSelectedText().c_str());
158 GetCPWLComboBox()->ReplaceSelection(L"");
159 EXPECT_STREQ(L"FGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqr",
160 GetCPWLComboBox()->GetText().c_str());
164 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
165 TypeTextIntoTextField(50);
167 GetCPWLComboBox()->SetEditSelection(45, 50);
168 EXPECT_STREQ(L"nopqr", GetCPWLComboBox()->GetSelectedText().c_str());
170 GetCPWLComboBox()->ReplaceSelection(L"");
171 EXPECT_STREQ(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklm",
172 GetCPWLComboBox()->GetText().c_str());
227 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
228 TypeTextIntoTextField(10);
230 GetCPWLComboBox()->SetEditSelection(0, -1);
231 EXPECT_STREQ(L"ABCDEFGHIJ", GetCPWLComboBox()->GetSelectedText().c_str());
232 GetCPWLComboBox()->ReplaceSelection(L"Hello");
233 EXPECT_STREQ(L"Hello", GetCPWLComboBox()->GetText().c_str());
238 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
239 TypeTextIntoTextField(10);
241 GetCPWLComboBox()->SetEditSelection(0, 5);
242 EXPECT_STREQ(L"ABCDE", GetCPWLComboBox()->GetSelectedText().c_str());
243 GetCPWLComboBox()->ReplaceSelection(L"Hello");
244 EXPECT_STREQ(L"HelloFGHIJ", GetCPWLComboBox()->GetText().c_str());
249 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
250 TypeTextIntoTextField(10);
252 GetCPWLComboBox()->SetEditSelection(2, 7);
253 EXPECT_STREQ(L"CDEFG", GetCPWLComboBox()->GetSelectedText().c_str());
254 GetCPWLComboBox()->ReplaceSelection(L"Hello");
255 EXPECT_STREQ(L"ABHelloHIJ", GetCPWLComboBox()->GetText().c_str());
260 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
261 TypeTextIntoTextField(10);
263 GetCPWLComboBox()->SetEditSelection(5, 10);
264 EXPECT_STREQ(L"FGHIJ", GetCPWLComboBox()->GetSelectedText().c_str());
265 GetCPWLComboBox()->ReplaceSelection(L"Hello");
266 EXPECT_STREQ(L"ABCDEHello", GetCPWLComboBox()->GetText().c_str());
270 FormFillerAndWindowSetup(GetCPDFSDKAnnotUserEditable());
271 TypeTextIntoTextField(10);
273 GetCPWLComboBox()->SetEditSelection(1, 3);
274 EXPECT_STREQ(L"ABCDEFGHIJ", GetCPWLComboBox()->GetText().c_str());
275 GetCPWLComboBox()->ReplaceAndKeepSelection(L"xyz");
276 EXPECT_STREQ(L"AxyzDEFGHIJ", GetCPWLComboBox()->GetText().c_str());
277 EXPECT_STREQ(L"xyz", GetCPWLComboBox()->GetSelectedText().c_str());
279 GetCPWLComboBox()->SetEditSelection(4, 1);
280 GetCPWLComboBox()->ReplaceAndKeepSelection(L"12");
281 EXPECT_STREQ(L"A12DEFGHIJ", GetCPWLComboBox()->GetText().c_str());
282 EXPECT_STREQ(L"12", GetCPWLComboBox()->GetSelectedText().c_str());