2
Q
SWT工具栏问题
A
回答
1
不幸的是,酷工具栏不具有对准场。然而,它确实有界限,可以用来将它对齐到右侧,并占据整个窗口的宽度。 CoolBar不允许高度超过21,因此必须考虑窗口尺寸的高度才能填满窗口。为此,计算必要的客户区大小,然后相应地调整shell的大小。 This thread可能有助于调整大小。
//This code will make the coolBar take up the entire window width running Windows 7 with default windows
Rectangle shellBounds = shell.getClientArea();
coolBar.setBounds(0, 0, shellBounds.width, shellBounds.height);
您可以使用此相同的逻辑来证明COOLBAR在屏幕的右侧。
//Justify the toolbar to the right side of the screen
int coolBarWidth = 200; //arbitrarily chosen dimensions
int coolBarHeight = 40;
coolBar.setBounds(shellBounds.width - coolBarWidth, 0, coolBarWidth, coolBarHeight);
此外,一些COOLBAR元件具有在它们的构造函数对准参数。
CLabel lblTest = new CLabel(coolBar, SWT.LEFT); //SWT.LEFT could be replaced with SWT.CENTER or SWT.RIGHT
我希望这有助于。
相关问题
- 1. Java SWT Mac统一工具栏布局问题
- 2. iPhone工具栏问题
- 3. JavaScript问题工具栏=否
- 4. IE工具栏Installatiobn问题
- 5. NavigationController和工具栏问题
- 6. iPad工具栏UI问题
- 7. 问题与UISPlitViewController工具栏
- 8. 工具栏和文本框问题
- 9. 问题与TabLayout实现工具栏..
- 10. 自定义工具栏问题
- 11. ConstraintLayout和工具栏的奇怪问题
- 12. Django调试工具栏安装问题
- 13. Kotlin工具栏菜单图标问题
- 14. 工具栏后退按钮问题
- 15. 工具栏菜单项间距问题
- 16. Word加载项工具栏问题
- 17. Excel 2003中的工具栏问题
- 18. wikiya工具栏和jQuery问题
- 19. 报告服务工具栏问题
- 20. Ios ::工具栏对齐问题
- 21. IE开发人员工具栏问题
- 22. Android工具栏布局问题
- 23. UINavigationController的工具栏:问题设置UIBarButtonItems
- 24. Xamarin.Android CustomActionBar(工具栏)布局问题
- 25. Swift:为UINavigationController工具栏添加工具栏按钮时遇到问题
- 26. SWT问题syncExec()
- 27. 工具栏和状态栏z订单问题
- 28. OS X上的SWT:统一的工具栏?
- 29. 关于Eclipse SWT ViewPart及其工具栏的疑惑?
- 30. 工具栏标题的项目对齐问题?