@@ -17,11 +17,11 @@ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ - + //================================================================================================================================== // OGButton.m //================================================================================================================================== #define BCM_GETIDEALSIZE 0x1601 #import "OGButton.h" @@ -52,20 +52,20 @@ } //---------------------------------------------------------------------------------------------------------------------------------- - init { self = [super init]; - + //we're specifying a different class name... //so we'll have to discard the default OGWidget HWND... DestroyWindow(widget); //and create a new one widget = NULL; HINSTANCE hInst = (HINSTANCE)GetModuleHandle(NULL); widget = CreateWindow("button", "", BS_PUSHBUTTON, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - NULL, NULL, hInst, NULL); + NULL, NULL, hInst, NULL); SetWindowLong(widget, GWL_STYLE, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP); //crazy workaround since we don't have control of our WNDPROC for default "button"s CommandHandlerData *chd = (CommandHandlerData *)malloc(sizeof(CommandHandlerData)); chd->funct = CH_Command; chd->object = self; @@ -80,11 +80,11 @@ - (OFString*)label { int tlen = GetWindowTextLength(widget); char *buff = (char *)malloc(tlen + 1); GetWindowText(widget, buff, tlen+1); - + OFString *ret = [OFString stringWithUTF8String : buff]; free(buff); return ret; } //----------------------------------------------------------------------------------------------------------------------------------