3 @SuppressWarnings public class QWidget : QObject {
8 public QWidget(long h) {
13 nativehandle = QtXnl.createQObject(QType.qtWidget,
this, 0);
14 if (nativehandle == 0) {
21 QtXnl.widget_set_int_bool_value(nativehandle, Constant.SETATTRIBUTE, flag, bOn);
24 public bool create(@NotNilptr QWidget parent) {
25 nativehandle = QtXnl.createQObject(QType.qtWidget,
this, parent.nativehandle);
26 if (nativehandle == 0) {
33 nativehandle = QtXnl.locaUiFile(uifile,
this, 0);
34 if (nativehandle == 0) {
39 public bool load(
String uifile, @NotNilptr QWidget parent) {
40 nativehandle = QtXnl.locaUiFile(uifile,
this, parent == nilptr ? 0l : parent.nativehandle);
41 if (nativehandle == 0) {
46 public bool load(@NotNilptr QBuffer data) {
47 nativehandle = QtXnl.locaUiData(data.nativehandle,
this, 0);
48 if (nativehandle == 0) {
53 public bool load(@NotNilptr QBuffer data, @NotNilptr QWidget parent) {
54 nativehandle = QtXnl.locaUiData(data.nativehandle,
this, parent == nilptr ? 0l : parent.nativehandle);
55 if (nativehandle == 0) {
62 return (QWidget)QtXnl.widget_get_object(nativehandle, Constant.GETPARENTWIDGET);
65 return (QLayout)QtXnl.widget_get_object(nativehandle, Constant.WIDGETGETLAYOUT);
68 QtXnl.widget_set_native_value(nativehandle, Constant.PARENTWIDGET,parent == nilptr ? 0l : parent.nativehandle);
72 return QtXnl.widget_get_double_value(nativehandle,Constant.OPACITY);
76 QtXnl.widget_set_bool_value(nativehandle, Constant.MODAL, bm);
80 QtXnl.widget_set_bool_value(nativehandle, Constant.QWIDGET_SETAUTOFILLBKGND, enabled);
84 return QtXnl.widget_get_bool_value(nativehandle, Constant.VISIBLE);
88 return QtXnl.widget_get_bool_value(nativehandle, Constant.MAXIMIZED);
92 return QtXnl.widget_get_bool_value(nativehandle, Constant.MINIMIZED);
96 return QtXnl.widget_get_bool_value(nativehandle, Constant.ENABLED);
100 return QtXnl.widget_get_bool_value(nativehandle, Constant.ACTIVED);
106 QtXnl.widget_set_double_value(nativehandle,Constant.OPACITY, v);
110 QtXnl.widget_set_bool_value(nativehandle, Constant.VISIBLE, v);
114 QtXnl.widget_set_bool_value(nativehandle, Constant.MAXIMIZED, v);
118 QtXnl.widget_set_bool_value(nativehandle, Constant.MINIMIZED, v);
122 QtXnl.widget_set_bool_value(nativehandle, Constant.ENABLED, v);
126 QtXnl.widget_set_bool_value(nativehandle, Constant.ACTIVED, v);
130 QtXnl.widget_set_v2int_value(nativehandle, Constant.QWIDGET_SETMINIMUMSIZE, w, h);
134 QtXnl.widget_set_vint_value(nativehandle, Constant.QWIDGET_SETMINIMUMHEIGHT, h);
138 QtXnl.widget_set_vint_value(nativehandle, Constant.QWIDGET_SETMINIMUMWIDTH, w);
142 QtXnl.widget_set_vint_value(nativehandle, Constant.WIDGET_SETINPUTMETHODHINTS, fcy);
146 return (InputMethodHint)QtXnl.widget_get_int_value(nativehandle, Constant.WIDGET_GETINPUTMETHODHINTS);
150 QtXnl.widget_set_vint_value(nativehandle, Constant.SETFOCUSPOLICY, fcy);
154 return QtXnl.widget_get_int_value(nativehandle, Constant.SETFOCUSPOLICY);
157 return QtXnl.widget_get_int_value(nativehandle, Constant.MINIMUMHEIGHT);
161 return QtXnl.widget_get_int_value(nativehandle, Constant.MAXIMUMHEIGHT);
165 return QtXnl.widget_get_int_value(nativehandle, Constant.MINIMUMWIDTH);
169 return QtXnl.widget_get_int_value(nativehandle, Constant.MAXIMUMWIDTH);
173 return QtXnl.widget_get_int_value(nativehandle, Constant.X_POS);
177 return QtXnl.widget_get_int_value(nativehandle, Constant.Y_POS);
181 return QtXnl.widget_get_int_value(nativehandle, Constant.WIDTH);
185 return QtXnl.widget_get_int_value(nativehandle, Constant.HEIGHT);
189 return QtXnl.widget_get_bool_value(nativehandle, Constant.FULLSCREEN);
193 return QtXnl.widget_get_bool_value(nativehandle, Constant.HIDDEN);
197 return QtXnl.widget_get_bool_value(nativehandle, Constant.MODAL);
201 return QtXnl.widget_get_bool_value(nativehandle, Constant.WINDOW);
205 QtXnl.widget_set_v2int_value(nativehandle, Constant.RESIZE, w, h);
209 QtXnl.widget_set_v2int_value(nativehandle, Constant.SETSIZEPOLICY, xp, yp);
213 QtXnl.widget_set_v2int_value(nativehandle, Constant.SCROLL, dx, dy);
217 QtXnl.widget_set_bkrl(nativehandle, role);
220 public void move(
int x,
int y) {
221 QtXnl.widget_set_v2int_value(nativehandle, Constant.MOVE, x, y);
225 QtXnl.widget_set_vint_value(nativehandle, Constant.FIXEDHEIGHT, h);
229 QtXnl.widget_set_intlongint_value(nativehandle, Constant.WIDGETSETPROXY, w.nativehandle, 0, 0);
233 QtXnl.widget_set_vint_value(nativehandle, Constant.WINDOWFLAG, flag);
237 QtXnl.widget_set_int_bool_value(nativehandle, Constant.SETWINDOWFLAG, flag, bOn);
240 return (
String)QtXnl.core_getString(nativehandle, Constant.GETSTYLESHEEY);
243 QtXnl.widget_set_native_value(nativehandle, Constant.ADDDEFACTION, action.nativehandle);
246 long [] al =
new long[actions.length];
247 for (
int i =0; i < al.length; i ++) {
248 al[i] = actions[i].nativehandle;
250 QtXnl.widget_set_object_value(nativehandle, Constant.ADDDEFACTION, al);
253 QtXnl.widget_set_native_value(nativehandle, Constant.QW_SETICON, icon.nativehandle);
256 QtXnl.widget_slot_string(nativehandle, Constant.WINDOWICON, icon);
259 QtXnl.widget_set_vint_value(nativehandle, Constant.SETCONTEXTMENUPOLICY, v);
262 QtXnl.widget_set_v2int_value(nativehandle, Constant.FIXEDSIZE, w, h);
265 QtXnl.widget_slot_string(nativehandle, Constant.SETWIDGETFONT, desc);
268 QtXnl.widget_set_vint_value(nativehandle, Constant.FIXEDWIDTH, w);
272 QtXnl.widget_set_v2int_value(nativehandle, Constant.PALETTE, flags, color);
277 QtXnl.widget_set_native_value(nativehandle, Constant.PALETTE, palette.nativehandle);
282 QtXnl.widget_set_native_value(nativehandle, Constant.STYLE, style.nativehandle);
287 QtXnl.widget_slot(nativehandle, Constant.CLOSE);
290 QtXnl.widget_slot(nativehandle, Constant.HIDE);
293 QtXnl.widget_slot(nativehandle, Constant.LOWER);
295 public void raise() {
296 QtXnl.widget_slot(nativehandle, Constant.RAISE);
299 QtXnl.widget_slot(nativehandle, Constant.REPAINT);
302 if (nativehandle != 0){
303 QtXnl.widget_slot(nativehandle, Constant.UPDATE);
307 QtXnl.widget_slot(nativehandle, Constant.SETFOCUS);
310 QtXnl.widget_slot(nativehandle, Constant.CLSFOCUS);
314 QtXnl.widget_slot_string(nativehandle, Constant.WINDOWTITLE, text);
319 QtXnl.widget_slot(nativehandle, Constant.SHOW);
323 QtXnl.widget_slot(nativehandle, Constant.SHOWFULLSCREEN);
327 QtXnl.widget_slot(nativehandle, Constant.SHOWMAX);
331 QtXnl.widget_slot(nativehandle, Constant.SHOWMIN);
335 QtXnl.widget_slot(nativehandle, Constant.SHOWNORMAL);
338 return QtXnl.long_string2_int2(nativehandle, Constant.MESSAGEBOXERR, caption, text, button, defaultBtn);
341 return QtXnl.long_string2_int2(nativehandle, Constant.MESSAGEBOXWAR, caption, text, button, defaultBtn);
345 return QtXnl.long_string2_int2(nativehandle, Constant.MESSAGEBOXQUE, caption, text, button, defaultBtn);
348 return QtXnl.long_string2_int2(nativehandle, Constant.MESSAGEBOXINF, caption, text, button, defaultBtn);
352 QtXnl.long_string2_int2(nativehandle, Constant.MESSAGEBOXABT, caption, text, 0, 0);
356 QtXnl.widget_set_vint_value(nativehandle, Constant.SETCURSOR, cursor);
359 @NotNilptr
public QPoint
mapTo(@NotNilptr QWidget w,
int x,
int y) {
362 v = QtXnl.long_intlong2(nativehandle, Constant.MAPPOINT, w.nativehandle, v);
363 return new QPoint(v);
368 v = QtXnl.long_intlong2(nativehandle, Constant.MAPPOINT, 0, v);
369 return new QPoint(v);
374 v = QtXnl.long_intlong2(0, Constant.MAPPOINT, nativehandle, v);
375 return new QPoint(v);
378 long xy = QtXnl.object_get_long_int(nativehandle, Constant.SCREENPOSITION, num, 0);
379 return new QPoint((
int)(xy >> 32) & 0xffffffff, (
int)xy & 0xffffffff);
382 long xy = QtXnl.object_get_long_int(nativehandle, Constant.SCREENPOSITION, -1, 0);
383 return new QPoint((
int)(xy >> 32) & 0xffffffff, (
int)xy & 0xffffffff);
386 long wh = QtXnl.object_get_long_int(nativehandle, Constant.SCREENSIZE, num, 0);
387 return new QRect(0, 0, (
int)(wh >> 32) & 0xffffffff, (
int)wh & 0xffffffff);
390 long wh = QtXnl.object_get_long_int(nativehandle, Constant.SCREENSIZE, -1, 0);
391 return new QRect(0, 0, (
int)(wh >> 32) & 0xffffffff, (
int)wh & 0xffffffff);
394 return QtXnl.widget_get_int_value(nativehandle, Constant.CURRENTSCREEN);
398 runOnUi(
new Runnable() {
400 QWidget.this.update();
405 QtXnl.widget_slot_string(nativehandle, Constant.SETSTYLESHEET, file);
408 QtXnl.widget_slot_string(nativehandle, Constant.SETSTYLE, styneName);
411 QtXnl.widget_slot_string(nativehandle, Constant.SETSTYLESHEETSTRING, stylesheet);
414 QtXnl.widget_slot_string(nativehandle, Constant.SETWHATSTHIS, tips);
417 QRect rc = getCurrentScreenSize();
418 rc.offset(getCurrentScreenPoint());
419 move((rc.width() - width()) / 2, (rc.height() - height()) / 2);
423 return QtXnl.widget_get_bool_value(nativehandle, Constant.HASFOCUS);
427 return (
String)QtXnl.core_getString(nativehandle, Constant.GETTOOLTIPS);
431 QtXnl.widget_slot_string(nativehandle, Constant.SETTOOLTIPS, text);
434 QtXnl.widget_set_native_value(nativehandle, Constant.SETLAYOUT, layout.nativehandle);
437 QtXnl.widget_set_native_value(nativehandle, Constant.QWIDGET_SETGRAPHICSEFFECT, effect.nativehandle);
440 QtXnl.widget_set_native_value(nativehandle, Constant.WIDGETREMOVELAYOUT, layout.nativehandle);
443 QtXnl.widget_set_native_value(nativehandle, Constant.WIDGETREMOVEWIDGET, widget.nativehandle);
446 QtXnl.widget_set_intlongstring_value(nativehandle, Constant.SHOWTOOLTIPS, ((
long)x) << 32 | y, (
int)duration, nilptr);
449 QtXnl.widget_set_intlongstring_value(nativehandle, Constant.SHOWTOOLTIPS, ((
long)x) << 32 | y, (
int)duration, text);
452 QtXnl.widget_set_intlongstring_value(0, Constant.SHOWTOOLTIPS, ((
long)x) << 32 | y, (
int) duration, text);
456 return QtXnl.widget_get_bool_value(nativehandle, Constant.ENABLEDROG);
460 QtXnl.widget_set_bool_value(nativehandle, Constant.ENABLEDROG, ba);
463 QtXnl.widget_set_vint_value(nativehandle, Constant.WIDGETSETDIRECTION, direction);
466 return (LayoutDirection)QtXnl.widget_get_int_value(nativehandle, Constant.WIDGETGETDIRECTION);
469 QtXnl.widget_slot(nativehandle, Constant.WIDGETUNSETDIRECTION);
472 QtXnl.widget_set_bool_value(nativehandle, Constant.UPDATEENABLE, be);
475 QtXnl.widget_slot(nativehandle, Constant.QWIDGET_ADJUSTSIZE);
478 return QtXnl.widget_get_bool_value(nativehandle,Constant.UPDATEENABLE );
480 public void render(@NotNilptr QPainter painter){
481 QtXnl.long_long_int9(nativehandle, Constant.WIDGETRENDER1, painter.hpaint, 0, 0, 0, 0, 0, 0, 0, 0, 0);
483 public void render(@NotNilptr QPainter painter, RenderFlag flags){
484 QtXnl.long_long_int9(nativehandle, Constant.WIDGETRENDER1, painter.hpaint, 0, 0, 0, 0, 0, 0, 0, flags, 0);
486 public void render(@NotNilptr QPainter painter,
int x,
int y, RenderFlag flags){
487 QtXnl.long_long_int9(nativehandle, Constant.WIDGETRENDER1, painter.hpaint, x, y, 0, 0, 0, 0, 0, flags, 0);
489 public void render(@NotNilptr QPainter painter,
int x,
int y,
int sx,
int sy,
int sw,
int sh,RegionType sflags, RenderFlag flags){
490 QtXnl.long_long_int9(nativehandle, Constant.WIDGETRENDER1, painter.hpaint, x, y, sx, sy, sw, sh, sflags, flags, 0);
493 long x = ((long)l << 32) | t, y = ((long)r << 32) |b;
494 QtXnl.void_long2(nativehandle, Constant.QWIDGET_SETCONTENTSMARGINS, x, y);
497 return (
String)QtXnl.core_getString(nativehandle, Constant.WIDGETGETTITLE);
500 return new QFont(QtXnl.long_get(nativehandle, Constant.WIDGETGETFONT));
504 QtXnl.widget_set_native_value(nativehandle, Constant.WIDSETGETFONT, f.nativehandle);
508 if (nativehandle != 0) {
509 runOnUi(
new Runnable(){
510 long handle = nativehandle;
512 QtXnl.widget_slot(handle, Constant.NATIVEFINALIZE);