void copy_ctx(const void * to, const void * from) { #ifdef DEBUG_ATTR load_buf(pointer2string(from), "from"); load_buf(pointer2string(to), "to"); sym("copy_attr"); #endif string_attributes[to] = string_attributes[from]; }
void load_ctx(const void * ctx, const char * attr, const char * hint) { #ifdef DEBUG_ATTR load_buf(pointer2string(ctx), "ctx"); load_buf(attr, "attr"); #endif print_rhs(string_attributes[ctx][string(attr)], hint); }
void add_to_attr(const void * ctx, const char * attr, const unsigned char * buf, size_t len) { #ifdef DEBUG_ATTR load_buf(pointer2string(ctx), "ctx"); load_buf(s, "attr"); load_buf(buf, len, "value"); sym("append_attr"); #endif string_attributes[ctx][string(attr)] += buffer2string(buf, len); }
/** DialogControl::init() * * The base init() for all dialog control objects. * * Initializes the WindowBase and sets the 3 attributes: id, hDlg, and oDlg. * These attributes are 'get' only attributes and can not be changed. */ RexxMethod2(uint32_t, dlgctrl_init, OPTIONAL_POINTER, args, OSELF, self) { RexxMethodContext *c = context; uint32_t result = 1; if ( argumentOmitted(1) || args == NULL ) { goto done_out; } // Set up for the DialogControl CSelf. RexxBufferObject cdcBuf = c->NewBuffer(sizeof(CDialogControl)); if ( cdcBuf == NULLOBJECT ) { goto done_out; } // Do the WindowBase initialization. pCWindowBase wbCSelf; PNEWCONTROLPARAMS params = (PNEWCONTROLPARAMS)args; if ( ! initWindowBase(context, params->hwnd, self, &wbCSelf) ) { goto done_out; } if ( ! initWindowExtensions(context, self, params->hwnd, wbCSelf, NULL) ) { goto done_out; } pCDialogControl cdcCSelf = (pCDialogControl)c->BufferData(cdcBuf); memset(cdcCSelf, 0, sizeof(CDialogControl)); cdcCSelf->controlType = params->controlType; cdcCSelf->lastItem = -1; cdcCSelf->wndBase = wbCSelf; cdcCSelf->rexxSelf = self; cdcCSelf->hCtrl = params->hwnd; cdcCSelf->id = params->id; cdcCSelf->hDlg = params->hwndDlg; cdcCSelf->oDlg = params->parentDlg; cdcCSelf->isInCategoryDlg = params->isCatDlg; context->SetObjectVariable("CSELF", cdcBuf); context->SetObjectVariable("ID", c->UnsignedInt32(params->id)); context->SetObjectVariable("HDLG", pointer2string(context, params->hwndDlg)); context->SetObjectVariable("ODLG", params->parentDlg); result = 0; done_out: return result; }
void store_ctx(const void * ctx, const char * attr, const char * hint) { string sattr = string(attr); unique_attr(ctx, sattr); print_lhs(string_attributes[ctx][sattr], hint); #ifdef DEBUG_ATTR load_buf(pointer2string(ctx), "ctx"); load_buf(attr, "attr"); sym("get_attr"); #endif }
void clear_attr(const void * ctx, const char * attr) { #ifdef DEBUG_ATTR load_buf(pointer2string(ctx), "ctx"); load_buf(attr, "attr"); sym("clear_attr"); #endif string sattr = string(attr); string_attributes[ctx][sattr] = ""; int_attributes[ctx][sattr] = 0; }
void set_attr_str(const void * ctx, const char * attr, const char * str) { if(strlen(str) == 0) cerr << "set_attr(char*): new value is empty" << endl; #ifdef DEBUG_ATTR load_buf(pointer2string(ctx), "ctx"); load_buf(s, "attr"); load_buf(string(str), "value"); sym("set_attr"); #endif string_attributes[ctx][string(attr)] = string(str); }
void set_attr_buf(const void * ctx, const char * attr, const unsigned char * buf, size_t len) { if(len == 0) cerr << "set_attr(buf, len): new value is empty" << endl; #ifdef DEBUG_ATTR load_buf(pointer2string(ctx), "ctx"); load_buf(s, "attr"); load_buf(buf, len, "value"); sym("set_attr"); #endif string_attributes[ctx][string(attr)] = buffer2string(buf, len); }
/** findWindow() * * Retrieves a window handle to the top-level window whose class name and * window name match the specified strings. This function does not search child * windows. This function does not perform a case-sensitive search. * * @param caption The title of the window to search for. Although this * argument is required, the empty string can be used to * indicate a null should be used for the caption. * * @param className [optional] Specifies the window class name of the window * to search for. The class name can be any name registered * with RegisterClass() or RegisterClassEx(), or any of the * predefined control-class names. * * If className is omitted, it finds any window whose title * matches the caption argument. * * @return The window handle if the window is found, otherwise 0. * * @note Sets the system error code. */ RexxRoutine2(RexxObjectPtr, findWindow_rtn, CSTRING, caption, OPTIONAL_CSTRING, className) { oodResetSysErrCode(context->threadContext); if ( strlen(caption) == 0 ) { caption = NULL; } HWND hwnd = FindWindow(className, caption); if ( hwnd == NULL ) { oodSetSysErrCode(context->threadContext); } return pointer2string(context->threadContext, hwnd); }
void copy_attr_ex(const void * to, const char * attr_to, const void * from, const char * attr_from) { string value = get_attr(from, string(attr_from)); if(value == "") cerr << "copy_attr(): new value is empty" << endl; #ifdef DEBUG_ATTR load_buf(pointer2string(ctx), "ctx"); load_buf(s, "attr"); load_buf(value, "value"); sym("copy_attr"); #endif string_attributes[to][string(attr_to)] = value; }
inline RexxObjectPtr hwndFrom2rexxArg(RexxThreadContext *c, LPARAM lParam) { return pointer2string(c, ((NMHDR *)lParam)->hwndFrom); }
/** DialogControl::captureMouse * * Sets the mouse capture to this dialog control. captureMouse() captures * mouse input either when the mouse is over the control, or when the mouse * button was pressed while the mouse was over the control and the button is * still down. Only one window at a time can capture the mouse. * * If the mouse cursor is over a window created by another thread, the system * will direct mouse input to the specified window only if a mouse button is * down. * * @return The window handle of the window that previously had captured the * mouse, or the null handle if there was no such window. */ RexxMethod1(RexxObjectPtr, dlgctrl_captureMouse, CSELF, pCSelf) { HWND oldCapture = (HWND)SendMessage(getDChDlg(pCSelf), WM_USER_GETSETCAPTURE, 1, (LPARAM)getDChCtrl(pCSelf)); return pointer2string(context, oldCapture); }