static BOOL OnInitDialog (HWND hwnd, HWND hwndFocus, LPARAM lParam) { LPSTORAGEPARAMS lpstructure = (LPSTORAGEPARAMS)lParam; char szFormat [100]; char szTitle [MAX_TITLEBAR_LEN]; char buffer [MAXOBJECTNAME]; LPUCHAR parentstrings [MAXPLEVEL]; HWND hwndContainer = GetDlgItem (hwnd, IDC_RELOCATE_CONTAINER); if (!AllocDlgProp (hwnd, lpstructure)) return FALSE; parentstrings [0] = lpstructure->DBName; if (lpstructure->nObjectType == OT_TABLE) { LoadString (hResource, (UINT)IDS_T_RELOCATE_TABLE, szFormat, sizeof (szFormat)); GetExactDisplayString ( lpstructure->objectname, lpstructure->objectowner, OT_TABLE, parentstrings, buffer); lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RELOCATE)); } else { LoadString (hResource, (UINT)IDS_T_RELOCATE_INDEX, szFormat, sizeof (szFormat)); GetExactDisplayString ( lpstructure->objectname, lpstructure->objectowner, OT_INDEX, parentstrings, buffer); lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_RELOC_IDX)); } wsprintf ( szTitle, szFormat, GetVirtNodeName (GetCurMdiNodeHandle ()), lpstructure->DBName, buffer); SetWindowText (hwnd, szTitle); //DuplicateLocationList (hwnd); InitContainer (hwndContainer, hwnd, 2); ContainerDisableDisplay (hwndContainer); FillAllData (hwnd); ContainerEnableDisplay (hwndContainer, TRUE); richCenterDialog (hwnd); return TRUE; }
void ServerContainer::Init(OpString * server_name, Image &server_icon) { InitContainer(server_name, server_icon); }
void ServerContainer::Init(OpString * server_name, OpBitmap * server_icon) { InitContainer(server_name, server_icon); }
nsresult RDFContentSinkImpl::OpenObject(const PRUnichar* aName, const PRUnichar** aAttributes) { // an "object" non-terminal is either a "description", a "typed // node", or a "container", so this change the content sink's // state appropriately. nsCOMPtr<nsIAtom> localName; const nsDependentSubstring& nameSpaceURI = SplitExpatName(aName, getter_AddRefs(localName)); // Figure out the URI of this object, and create an RDF node for it. nsCOMPtr<nsIRDFResource> source; GetIdAboutAttribute(aAttributes, getter_AddRefs(source)); // If there is no `ID' or `about', then there's not much we can do. if (! source) return NS_ERROR_FAILURE; // Push the element onto the context stack PushContext(source, mState, mParseMode); // Now figure out what kind of state transition we need to // make. We'll either be going into a mode where we parse a // description or a container. PRBool isaTypedNode = PR_TRUE; if (nameSpaceURI.EqualsLiteral(RDF_NAMESPACE_URI)) { isaTypedNode = PR_FALSE; if (localName == kDescriptionAtom) { // it's a description mState = eRDFContentSinkState_InDescriptionElement; } else if (localName == kBagAtom) { // it's a bag container InitContainer(kRDF_Bag, source); mState = eRDFContentSinkState_InContainerElement; } else if (localName == kSeqAtom) { // it's a seq container InitContainer(kRDF_Seq, source); mState = eRDFContentSinkState_InContainerElement; } else if (localName == kAltAtom) { // it's an alt container InitContainer(kRDF_Alt, source); mState = eRDFContentSinkState_InContainerElement; } else { // heh, that's not *in* the RDF namespace: just treat it // like a typed node isaTypedNode = PR_TRUE; } } if (isaTypedNode) { const char* attrName; localName->GetUTF8String(&attrName); NS_ConvertUTF16toUTF8 typeStr(nameSpaceURI); typeStr.Append(attrName); nsCOMPtr<nsIRDFResource> type; nsresult rv = gRDFService->GetResource(typeStr, getter_AddRefs(type)); if (NS_FAILED(rv)) return rv; rv = mDataSource->Assert(source, kRDF_type, type, PR_TRUE); if (NS_FAILED(rv)) return rv; mState = eRDFContentSinkState_InDescriptionElement; } AddProperties(aAttributes, source); return NS_OK; }