View Javadoc

1   /**
2    * .
3    */
4   package org.sirius.server.win32.classes;
5   
6   import javax.jws.WebService;
7   
8   import com.sun.jna.Pointer;
9   import com.sun.jna.platform.win32.WinDef.HWND;
10  
11  /**
12   * @author Myk Kolisnyk
13   * .
14   */
15  @WebService
16  public class Dialog extends Common {
17  
18      /**
19  	 * .
20  	 */
21      public Dialog() {
22          // TODO Auto-generated constructor stub
23      }
24  
25      /**
26       * .
27       * @return .
28       */
29      public final long getDialogBaseUnits() {
30          return this.getDlg32().GetDialogBaseUnits();
31      }
32  
33      /**
34       * .
35       * @param hWnd .
36       * @return .
37       */
38      public final int getDlgCtrlID(final long hWnd) {
39          HWND handle = this.longToHwnd(hWnd);
40          return this.getDlg32().GetDlgCtrlID(handle);
41      }
42  
43      /**
44       * .
45       * @param hWnd .
46       * @param itemId .
47       * @return .
48       */
49      public final long getDlgItem(final long hWnd, final int itemId) {
50          HWND handle = this.longToHwnd(hWnd);
51          return Pointer.nativeValue(this.getDlg32().GetDlgItem(handle, itemId)
52                  .getPointer());
53      }
54  
55      /**
56       * .
57       * @param hWnd .
58       * @param itemId .
59       * @param pbool .
60       * @param flag2 .
61       * @return .
62       */
63      public final int getDlgItemInt(final long hWnd, final int itemId,
64              final boolean pbool, final boolean flag2) {
65          HWND handle = this.longToHwnd(hWnd);
66          return this.getDlg32().GetDlgItemInt(handle, itemId, pbool, flag2);
67      }
68  
69      /**
70       * .
71       * @param hWnd .
72       * @param itemId .
73       * @return .
74       */
75      public final String getDlgItemTextA(final long hWnd, final int itemId) {
76          HWND handle = this.longToHwnd(hWnd);
77  
78          int length = 255;
79          char[] buf = new char[length];
80  
81          getDlg32().GetDlgItemTextA(handle, itemId, buf, length);
82          String text = String.valueOf(buf).trim();
83          return text;
84      }
85  
86      /**
87       * .
88       * @param hWnd .
89       * @param itemId .
90       * @return .
91       */
92      public final int isDlgButtonChecked(final long hWnd, final int itemId) {
93          HWND handle = this.longToHwnd(hWnd);
94          return getDlg32().IsDlgButtonChecked(handle, itemId);
95      }
96  
97      /**
98       * .
99       * @param hWnd .
100      * @param itenId .
101      * @param intValue .
102      * @param flag .
103      * @return .
104      */
105     public final boolean setDlgItemInt(final long hWnd, final int itenId,
106             final int intValue, final boolean flag) {
107         HWND handle = this.longToHwnd(hWnd);
108         return getDlg32().SetDlgItemInt(handle, itenId, intValue, flag);
109     }
110 
111     /**
112      * .
113      * @param hWnd .
114      * @param itemId .
115      * @param text .
116      * @return .
117      */
118     public final boolean setDlgItemText(final long hWnd, final int itemId,
119             final String text) {
120         HWND handle = this.longToHwnd(hWnd);
121         return getDlg32().SetDlgItemTextA(handle, itemId, text.toCharArray());
122     }
123 
124 }