diff options
| author | Pietro Gagliardi <[email protected]> | 2016-05-30 00:14:46 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2016-05-30 00:14:46 -0400 |
| commit | 52f7d276a6bb04b8827ac019ad1e135b43819cea (patch) | |
| tree | 5f0ebbfdf5885ef832e77e243b5916e59f46ba18 /prev/progressbar_windows.go | |
| parent | c9b32c1333e4009b342eedc5f5b39127a724fb42 (diff) | |
Removed prev/.
Diffstat (limited to 'prev/progressbar_windows.go')
| -rw-r--r-- | prev/progressbar_windows.go | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/prev/progressbar_windows.go b/prev/progressbar_windows.go deleted file mode 100644 index 807b0c1..0000000 --- a/prev/progressbar_windows.go +++ /dev/null @@ -1,52 +0,0 @@ -// 4 november 2014 - -package ui - -import ( - "fmt" -) - -// #include "winapi_windows.h" -import "C" - -type progressbar struct { - *controlSingleHWND -} - -func newProgressBar() ProgressBar { - hwnd := C.newControl(C.xPROGRESS_CLASS, - C.PBS_SMOOTH, - 0) - p := &progressbar{ - controlSingleHWND: newControlSingleHWND(hwnd), - } - p.fpreferredSize = p.xpreferredSize - p.fnTabStops = func() int { - // progress bars are not tab stops - return 0 - } - return p -} - -func (p *progressbar) Percent() int { - return int(C.SendMessageW(p.hwnd, C.PBM_GETPOS, 0, 0)) -} - -func (p *progressbar) SetPercent(percent int) { - if percent < 0 || percent > 100 { - panic(fmt.Errorf("given ProgressBar percentage %d out of range", percent)) - } - // TODO circumvent aero - C.SendMessageW(p.hwnd, C.PBM_SETPOS, C.WPARAM(percent), 0) -} - -const ( - // via http://msdn.microsoft.com/en-us/library/windows/desktop/dn742486.aspx - // this is the double-width option - progressbarWidth = 237 - progressbarHeight = 8 -) - -func (p *progressbar) xpreferredSize(d *sizing) (width, height int) { - return fromdlgunitsX(progressbarWidth, d), fromdlgunitsY(progressbarHeight, d) -} |
