Added most of the Windows implementation of ProgressBar. Now to grab the comctl32.dll stuff.

This commit is contained in:
Pietro Gagliardi 2014-02-25 01:02:16 -05:00
parent d8c0df7993
commit 668de3bccb
2 changed files with 32 additions and 7 deletions

View File

@ -53,6 +53,10 @@ var stdDlgSizes = [nctypes]dlgunits{
// height is not clearly defined here ("an integral number of items (3 items minimum)") so just use a three-line edit control
height: 14 + 10 + 10,
},
c_progressbar: dlgunits{
width: 237, // the first reference says 107 also works; TODO decide which to use
height: 8,
},
}
var (

View File

@ -92,6 +92,11 @@ var classTypes = [nctypes]*classData{
selectedIndexErr: _LB_ERR,
addSpaceErr: _LB_ERRSPACE,
},
c_progressbar: &classData{
name: XXXXX,
style: _PBS_SMOOTH | controlstyle,
xstyle: 0 | controlxstyle,
},
}
func (s *sysData) addChild(child *sysData) _HMENU {
@ -501,3 +506,19 @@ func (s *sysData) delete(index int) (err error) {
}
return nil
}
func (s *sysData) setProgress(percent int) {
ret := make(chan uiret)
defer close(ret)
uitask <- &uimsg{
call: _sendMessage,
p: []uintptr{
uintptr(s.hwnd),
uintptr(_PBM_SETPOS),
uintptr(_WPARAM(percent)),
uintptr(0),
},
ret: ret,
}
<-ret
}