Re: [XWP] Widget-Wiederherstellung im XCenter



Jörg Rustmeier schrieb:
Weiß jemand, wie man die eingebauten Widgets nach Verlust wiederherstellt? Konkret hätte ich das "Systemabschluß"-Widget gern wieder.
Aus instl049.cmd (ist so ähnlich auch in instl001.cmd zu finden):

/* the following three added with V0.9.19 */
Lockup = "Sperren";
FindObjects = "Suchen";
Shutdown = "Systemabschluß";

....

/* the following three added with V0.9.19
and redone with V0.9.20 */
commonXWPString = "DEFAULTOBJECT=<WP_DESKTOP>;CONFIRMINVOCATION=NO;NOSTRINGPAGE=YES;HELPLIBRARY=WPHELP.HLP;HELPPANEL"

/* create "Lockup" setup string object */
class = "XWPString";
title = Lockup;
setup = "SETUPSTRING=MENUITEMSELECTED%3D705%3B;"commonXWPString"=8004;ICONRESOURCE=78,PMWP;"
id = "<XWP_LOCKUPSTR>"
target = "<WP_NOWHERE>";
call CreateObject;

/* create "Find objects" setup string object */
class = "XWPString";
title = FindObjects;
setup = "SETUPSTRING=MENUITEMSELECTED%3D8%3B;"commonXWPString"=1205;ICONRESOURCE=79,PMWP;";
id = "<XWP_FINDSTR>";
target = "<WP_NOWHERE>";
call CreateObject;

/* create "Shutdown" setup string object */
/* setup string modified to use POSTSHUTDOWN=YES V0.9.20 */
class = "XWPString";
title = Shutdown;
setup = "SETUPSTRING=POSTSHUTDOWN%3DYES%3B;"commonXWPString"=4001;ICONRESOURCE=80,PMWP;"
id = "<XWP_SHUTDOWNSTR>";
target = "<WP_NOWHERE>";
call CreateObject;

....

CreateObject:
len = length(id);
if (len == 0) then do
Say 'Error with object "'title'": object ID not given.';
exit;
end

if (left(id, 1) \= '<') then do
Say 'Error with object "'title'": object ID does not start with "<".';
exit;
end

if (right(id, 1) \= '>') then do
Say 'Error with object "'title'": object ID does not end with ">".';
exit;
end

len = length(setup);
if ((len > 0) & (right(setup, 1) \= ';')) then do
Say 'Error with object "'title'": Setup string "'setup'" does not end in semicolon.';
exit;
end
call charout , 'Creating "'title'" of class "'class'", setup "'setup'"... '
rc = SysCreateObject(class, title, target, setup"TITLE="title";OBJECTID="id";", "U");
if (\rc) then do
rc = SysCreateObject(class, title, "<WP_DESKTOP>", setup"TITLE="title";OBJECTID="id";", "U");
end;
if (\rc) then do
Say 'Warning: object "'title'" of class "'class'" could not be created.'
end
else do
Say "OK"
end

id = "";

return;


bedeutet also, die Dinger werden als XWPString Objekte im <WP_NOWHERE> Ordner mit ganz bestimmten IDs (sowie Icons und Helppanels) angelegt.
.



Relevant Pages