org.eclipse.swt.widgets.Button.selectRadio()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.eclipse.swt.widgets.Button.selectRadio()方法的一些代码示例,展示了Button.selectRadio()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.selectRadio()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:selectRadio

Button.selectRadio介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

  1. @Override
  2. LRESULT wmCommandChild (int /*long*/ wParam, int /*long*/ lParam) {
  3. int code = OS.HIWORD (wParam);
  4. switch (code) {
  5. case OS.BN_CLICKED:
  6. case OS.BN_DOUBLECLICKED:
  7. if ((style & (SWT.CHECK | SWT.TOGGLE)) != 0) {
  8. setSelection (!getSelection ());
  9. } else {
  10. if ((style & SWT.RADIO) != 0) {
  11. if ((parent.getStyle () & SWT.NO_RADIO_GROUP) != 0) {
  12. setSelection (!getSelection ());
  13. } else {
  14. selectRadio ();
  15. }
  16. }
  17. }
  18. sendSelectionEvent (SWT.Selection);
  19. }
  20. return super.wmCommandChild (wParam, lParam);
  21. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

  1. @Override
  2. int /*long*/ gtk_clicked (int /*long*/ widget) {
  3. if ((style & SWT.RADIO) != 0) {
  4. if ((parent.getStyle () & SWT.NO_RADIO_GROUP) != 0) {
  5. setSelection (!selected);
  6. } else {
  7. selectRadio ();
  8. }
  9. } else {
  10. if ((style & SWT.CHECK) != 0) {
  11. if (grayed) {
  12. if (OS.gtk_toggle_button_get_active (handle)) {
  13. OS.gtk_toggle_button_set_inconsistent (handle, true);
  14. } else {
  15. OS.gtk_toggle_button_set_inconsistent (handle, false);
  16. }
  17. }
  18. }
  19. }
  20. sendSelectionEvent (SWT.Selection);
  21. return 0;
  22. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

  1. @Override
  2. long /*int*/ gtk_clicked (long /*int*/ widget) {
  3. if ((style & SWT.RADIO) != 0) {
  4. if ((parent.getStyle () & SWT.NO_RADIO_GROUP) != 0) {
  5. setSelection (!selected);
  6. } else {
  7. selectRadio ();
  8. }
  9. } else {
  10. if ((style & SWT.CHECK) != 0) {
  11. if (grayed) {
  12. if (OS.gtk_toggle_button_get_active (handle)) {
  13. OS.gtk_toggle_button_set_inconsistent (handle, true);
  14. } else {
  15. OS.gtk_toggle_button_set_inconsistent (handle, false);
  16. }
  17. }
  18. }
  19. }
  20. sendSelectionEvent (SWT.Selection);
  21. return 0;
  22. }

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

  1. @Override
  2. int /*long*/ gtk_clicked (int /*long*/ widget) {
  3. if ((style & SWT.RADIO) != 0) {
  4. if ((parent.getStyle () & SWT.NO_RADIO_GROUP) != 0) {
  5. setSelection (!selected);
  6. } else {
  7. selectRadio ();
  8. }
  9. } else {
  10. if ((style & SWT.CHECK) != 0) {
  11. if (grayed) {
  12. if (OS.gtk_toggle_button_get_active (handle)) {
  13. OS.gtk_toggle_button_set_inconsistent (handle, true);
  14. } else {
  15. OS.gtk_toggle_button_set_inconsistent (handle, false);
  16. }
  17. }
  18. }
  19. }
  20. sendSelectionEvent (SWT.Selection);
  21. return 0;
  22. }

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

  1. void sendSelection () {
  2. if ((style & SWT.RADIO) != 0) {
  3. if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
  4. selectRadio ();
  5. }
  6. }
  7. if ((style & SWT.CHECK) != 0) {
  8. if (grayed && ((NSButton)view).state() == OS.NSOnState) {
  9. ((NSButton)view).setState(OS.NSOffState);
  10. }
  11. if (!grayed && ((NSButton)view).state() == OS.NSMixedState) {
  12. ((NSButton)view).setState(OS.NSOnState);
  13. }
  14. }
  15. sendSelectionEvent (SWT.Selection);
  16. }

相关文章

Button类方法