Welcome to TiddlyWiki created by Jeremy Ruston; Copyright © 2004-2007 Jeremy Ruston, Copyright © 2007-2011 UnaMesa Association
~OpenOffice/~LibreOffice Base with ~Access2Base
//{{{
REM Open a form ...
OpenForm("myForm")
REM Move a form to new left-top coordinates ...
Dim ofForm As Object
Set ofForm = Forms("myForm")
Move(ofForm, 100, 200)
REM Get the value of a control ...
Dim ocControl As Object
ocControl = Controls(ofForm, "myControl")
MsgBox ocControl.Value
REM Hide a control ...
setVisible(ocControl, False)
REM ... or alternatively ...
setValue("Forms!myForm!myControl.Visible", False) ' Shortcut notation
//}}}
~MSAccess VBA
//{{{
REM Open a form ...
DoCmd.OpenForm("myForm")
REM Move a form to new left-top coordinates ...
Dim ofForm As Form
Set ofForm = Forms("myForm")
ofForm.Move(100, 200)
REM Get the value of a control ...
Dim ocControl As Control
ocControl = ofForm.Controls("myControl")
MsgBox ocControl.Value
REM Hide a control ...
ocControl.Visible = False
REM ... or alternatively ...
Forms!myForm!myControl.Visible = False
//}}}
Type the text for 'Actions'
The //~AllForms// collection describes instances of all __forms__ present in the database document (".odb" file).
!!!Syntax
{{{AllForms()}}} or {{{AllForms}}}
{{{AllForms(index)}}}
{{{AllForms(formname)}}}
| !Argument #1 | !Type |!Returned value |
|| absent |A [[Collection]] object |
| index | integer<br>long |A [[Form]] object corresponding to the index-th item in the ~AllForms() collection. The 1st form is ~AllForms(0), the 2nd is ~AllForms(1) and so on ... The last one is ~AllForms.Count - 1.|
| formname | string |A [[Form]] object having the argument as name. The argument is NOT case-sensitive.|
!!!Remarks
*~Access2Base does not support a hierarchy of form names although Base does it. Only single form names are allowed.
*The //formname// argument is not case sensitive.
!!!Error messages
|Argument nr.1 is invalid |
|Out of array range or incorrect array size for collection ~AllForms() |
|Form "..." not found |
!!!Examples
<<tiddler "AllForms examples">>
To display the name of all forms (uses the [[Name]] property):
//{{{
Dim i As Integer, oCollection As Object
Set oCollection = AllForms
For i = 0 To oCollection.Count - 1 'AllForms without argument returns a Collection object
Print AllForms(i).pName, 'AllForms(...) with an argument returns a Form object
Next i
Print
//}}}
Can shorter ... :
//{{{
Dim i As Integer
For i = 0 To AllForms.Count - 1 'AllForms without argument returns a Collection object
Print AllForms(i).pName, 'AllForms(...) with an argument returns a Form object
Next i
Print
//}}}
To know the exact name of a form:
//{{{
Dim ofForm As Object
Set ofForm = AllForms("MYFORM") 'Exact name = myForm :o)
MsgBox ofForm.pName
//}}}
Make a form read-only
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
setAllowEdits(ofForm, False)
setAllowDeletions(ofForm, False)
setAllowAdditions(ofForm, False)
//}}}
The //~AllowAdditions// property specifies whether a user can add a record when using a form.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
|[[SubForm]] |A subform in an open form |
!!!Syntax
//form//{{{.AllowAdditions}}}
{{{getAllowAdditions(}}}//form//{{{)}}}
{{{setAllowAdditions(}}}//form//{{{,}}}//value//{{{)}}}
//subform//{{{.AllowAdditions}}}
{{{getAllowAdditions(}}}//subform//{{{)}}}
{{{setAllowAdditions(}}}//subform//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[AllowDeletions]]
[[AllowEdits]]
!!!Example
<<tiddler "Allow example">>
The //~AllowDeletions// property specifies whether a user can delete a record when using a form.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
|[[SubForm]] |A subform in an open form |
!!!Syntax
//form//{{{.AllowDeletions}}}
{{{getAllowDeletions(}}}//form//{{{)}}}
{{{setAllowDeletions(}}}//form//{{{,}}}//value//{{{)}}}
//subform//{{{.AllowDeletions}}}
{{{getAllowDeletions(}}}//subform//{{{)}}}
{{{setAllowDeletions(}}}//subform//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[AllowAdditions]]
[[AllowEdits]]
!!!Example
<<tiddler "Allow example">>
The //~AllowEdits// property specifies whether a user can edit saved records when using a form.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
|[[SubForm]] |A subform in an open form |
!!!Syntax
//form//{{{.AllowEdits}}}
{{{getAllowEdits(}}}//form//{{{)}}}
{{{setAllowEdits(}}}//form//{{{,}}}//value//{{{)}}}
//subform//{{{.AllowEdits}}}
{{{getAllowEdits(}}}//subform//{{{)}}}
{{{setAllowEdits(}}}//subform//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[AllowAdditions]]
[[AllowDeletions]]
!!!Example
<<tiddler "Allow example">>
text/plain
.txt .text .js .vbs .asp .cgi .pl
----
text/html
.htm .html .hta .htx .mht
----
text/comma-separated-values
.csv
----
text/javascript
.js
----
text/css
.css
----
text/xml
.xml .xsl .xslt
----
image/gif
.gif
----
image/jpeg
.jpg .jpe .jpeg
----
image/png
.png
----
image/bmp
.bmp
----
image/tiff
.tif .tiff
----
audio/basic
.au .snd
----
audio/wav
.wav
----
audio/x-pn-realaudio
.ra .rm .ram
----
audio/x-midi
.mid .midi
----
audio/mp3
.mp3
----
audio/m3u
.m3u
----
video/x-ms-asf
.asf
----
video/avi
.avi
----
video/mpeg
.mpg .mpeg
----
video/quicktime
.qt .mov .qtvr
----
application/pdf
.pdf
----
application/rtf
.rtf
----
application/postscript
.ai .eps .ps
----
application/wordperfect
.wpd
----
application/mswrite
.wri
----
application/msexcel
.xls .xls3 .xls4 .xls5 .xlw
----
application/msword
.doc
----
application/mspowerpoint
.ppt .pps
----
application/x-director
.swa
----
application/x-shockwave-flash
.swf
----
application/x-zip-compressed
.zip
----
application/x-gzip
.gz
----
application/x-rar-compressed
.rar
----
application/octet-stream
.com .exe .dll .ocx
----
application/java-archive
.jar
/***
|Name|AttachFilePlugin|
|Source|http://www.TiddlyTools.com/#AttachFilePlugin|
|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|
|Version|4.0.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|AttachFilePluginFormatters, AttachFileMIMETypes|
|Description|Store binary files as base64-encoded tiddlers with fallback links for separate local and/or remote file storage|
Store or link binary files (such as jpg, gif, pdf or even mp3) within your TiddlyWiki document and then use them as images or links from within your tiddler content.
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
!!!!!Documentation
>see [[AttachFilePluginInfo]]
!!!!!Inline interface (live)
>see [[AttachFile]] (shadow tiddler)
><<tiddler AttachFile>>
!!!!!Revisions
<<<
2011.02.14 4.0.1 fix OSX error: use picker.file.path
2009.06.04 4.0.0 changed attachment storage format to use //sections// instead of embedded substring markers.
|please see [[AttachFilePluginInfo]] for additional revision details|
2005.07.20 1.0.0 Initial Release
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.AttachFilePlugin= {major: 4, minor: 0, revision: 1, date: new Date(2011,2,14)};
// shadow tiddler
config.shadowTiddlers.AttachFile="<<attach inline>>";
// add 'attach' backstage task (insert before built-in 'importTask')
if (config.tasks) { // for TW2.2b or above
config.tasks.attachTask = {
text: "attach",
tooltip: "Attach a binary file as a tiddler",
content: "<<attach inline>>"
}
config.backstageTasks.splice(config.backstageTasks.indexOf("importTask"),0,"attachTask");
}
config.macros.attach = {
// // lingo
//{{{
label: "attach file",
tooltip: "Attach a file to this document",
linkTooltip: "Attachment: ",
typeList: "AttachFileMIMETypes",
titlePrompt: " enter tiddler title...",
MIMEPrompt: "<option value=''>select MIME type...</option><option value='editlist'>[edit list...]</option>",
localPrompt: " enter local path/filename...",
URLPrompt: " enter remote URL...",
tiddlerErr: "Please enter a tiddler title",
sourceErr: "Please enter a source path/filename",
storageErr: "Please select a storage method: embedded, local or remote",
MIMEErr: "Unrecognized file format. Please select a MIME type",
localErr: "Please enter a local path/filename",
URLErr: "Please enter a remote URL",
fileErr: "Invalid path/file or file not found",
tiddlerFormat: '!usage\n{{{%0}}}\n%0\n!notes\n%1\n!type\n%2\n!file\n%3\n!url\n%4\n!data\n%5\n',
//}}}
// // macro definition
//{{{
handler:
function(place,macroName,params) {
if (params && !params[0])
{ createTiddlyButton(place,this.label,this.tooltip,this.toggleAttachPanel); return; }
var id=params.shift();
this.createAttachPanel(place,id+"_attachPanel",params);
document.getElementById(id+"_attachPanel").style.position="static";
document.getElementById(id+"_attachPanel").style.display="block";
},
//}}}
//{{{
createAttachPanel:
function(place,panel_id,params) {
if (!panel_id || !panel_id.length) var panel_id="_attachPanel";
// remove existing panel (if any)
var panel=document.getElementById(panel_id); if (panel) panel.parentNode.removeChild(panel);
// set styles for this panel
setStylesheet(this.css,"attachPanel");
// create new panel
var title=""; if (params && params[0]) title=params.shift();
var types=this.MIMEPrompt+this.formatListOptions(store.getTiddlerText(this.typeList)); // get MIME types
panel=createTiddlyElement(place,"span",panel_id,"attachPanel",null);
var html=this.html.replace(/%id%/g,panel_id);
html=html.replace(/%title%/g,title);
html=html.replace(/%disabled%/g,title.length?"disabled":"");
html=html.replace(/%IEdisabled%/g,config.browser.isIE?"disabled":"");
html=html.replace(/%types%/g,types);
panel.innerHTML=html;
if (config.browser.isGecko) { // FF3 FIXUP
document.getElementById("attachSource").style.display="none";
document.getElementById("attachFixPanel").style.display="block";
}
return panel;
},
//}}}
//{{{
toggleAttachPanel:
function (e) {
if (!e) var e = window.event;
var parent=resolveTarget(e).parentNode;
var panel = document.getElementById("_attachPanel");
if (panel==undefined || panel.parentNode!=parent)
panel=config.macros.attach.createAttachPanel(parent,"_attachPanel");
var isOpen = panel.style.display=="block";
if(config.options.chkAnimate)
anim.startAnimating(new Slider(panel,!isOpen,e.shiftKey || e.altKey,"none"));
else
panel.style.display = isOpen ? "none" : "block" ;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
},
//}}}
//{{{
formatListOptions:
function(text) {
if (!text || !text.trim().length) return "";
// get MIME list content from text
var parts=text.split("\n----\n");
var out="";
for (var p=0; p<parts.length; p++) {
var lines=parts[p].split("\n");
var label=lines.shift(); // 1st line=display text
var value=lines.shift(); // 2nd line=item value
out +='<option value="%1">%0</option>'.format([label,value]);
}
return out;
},
//}}}
// // interface definition
//{{{
css:
".attachPanel { display: none; position:absolute; z-index:10; width:35em; right:105%; top:0em;\
background-color: #eee; color:#000; font-size: 8pt; line-height:110%;\
border:1px solid black; border-bottom-width: 3px; border-right-width: 3px;\
padding: 0.5em; margin:0em; -moz-border-radius:1em;-webkit-border-radius:1em; text-align:left }\
.attachPanel form { display:inline;border:0;padding:0;margin:0; }\
.attachPanel select { width:99%;margin:0px;font-size:8pt;line-height:110%;}\
.attachPanel input { width:98%;padding:0px;margin:0px;font-size:8pt;line-height:110%}\
.attachPanel textarea { width:98%;margin:0px;height:2em;font-size:8pt;line-height:110%}\
.attachPanel table { width:100%;border:0;margin:0;padding:0;color:inherit; }\
.attachPanel tbody, .attachPanel tr, .attachPanel td { border:0;margin:0;padding:0;color:#000; }\
.attachPanel .box { border:1px solid black; padding:.3em; margin:.3em 0px; background:#f8f8f8; \
-moz-border-radius:5px;-webkit-border-radius:5px; }\
.attachPanel .chk { width:auto;border:0; }\
.attachPanel .btn { width:auto; }\
.attachPanel .btn2 { width:49%; }\
",
//}}}
//{{{
html:
'<form>\
attach from source file\
<input type="file" id="attachSource" name="source" size="56"\
onChange="config.macros.attach.onChangeSource(this)">\
<div id="attachFixPanel" style="display:none"><!-- FF3 FIXUP -->\
<input type="text" id="attachFixSource" style="width:90%"\
title="Enter a path/file to attach"\
onChange="config.macros.attach.onChangeSource(this);">\
<input type="button" style="width:7%" value="..."\
title="Enter a path/file to attach"\
onClick="config.macros.attach.askForFilename(document.getElementById(\'attachFixSource\'));">\
</div><!--end FF3 FIXUP-->\
<div class="box">\
<table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
embed data <input type=checkbox class=chk name="useData" %IEdisabled% \
onclick="if (!this.form.MIMEType.value.length)\
this.form.MIMEType.selectedIndex=this.checked?1:0; "> \
</td><td style="border:0">\
<select size=1 name="MIMEType" \
onchange="this.title=this.value; if (this.value==\'editlist\')\
{ this.selectedIndex=this.form.useData.checked?1:0; story.displayTiddler(null,config.macros.attach.typeList,2); return; }">\
<option value=""></option>\
%types%\
</select>\
</td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
local link <input type=checkbox class=chk name="useLocal"\
onclick="this.form.local.value=this.form.local.defaultValue=this.checked?config.macros.attach.localPrompt:\'\';"> \
</td><td style="border:0">\
<input type=text name="local" size=15 autocomplete=off value=""\
onchange="this.form.useLocal.checked=this.value.length" \
onkeyup="this.form.useLocal.checked=this.value.length" \
onfocus="if (!this.value.length) this.value=config.macros.attach.localPrompt; this.select()">\
</td></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
remote link <input type=checkbox class=chk name="useURL"\
onclick="this.form.URL.value=this.form.URL.defaultValue=this.checked?config.macros.attach.URLPrompt:\'\';\"> \
</td><td style="border:0">\
<input type=text name="URL" size=15 autocomplete=off value=""\
onfocus="if (!this.value.length) this.value=config.macros.attach.URLPrompt; this.select()"\
onchange="this.form.useURL.checked=this.value.length;"\
onkeyup="this.form.useURL.checked=this.value.length;">\
</td></tr></table>\
</div>\
<table style="border:0"><tr style="border:0"><td style="border:0;text-align:right;vertical-align:top;width:1%;white-space:nowrap">\
notes \
</td><td style="border:0" colspan=2>\
<textarea name="notes" style="width:98%;height:3.5em;margin-bottom:2px"></textarea>\
</td><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
attach as \
</td><td style="border:0" colspan=2>\
<input type=text name="tiddlertitle" size=15 autocomplete=off value="%title%"\
onkeyup="if (!this.value.length) { this.value=config.macros.attach.titlePrompt; this.select(); }"\
onfocus="if (!this.value.length) this.value=config.macros.attach.titlePrompt; this.select()" %disabled%>\
</td></tr></tr><tr style="border:0"><td style="border:0;text-align:right;width:1%;white-space:nowrap">\
add tags \
</td><td style="border:0">\
<input type=text name="tags" size=15 autocomplete=off value="" onfocus="this.select()">\
</td><td style="width:40%;text-align:right;border:0">\
<input type=button class=btn2 value="attach"\
onclick="config.macros.attach.onClickAttach(this)"><!--\
--><input type=button class=btn2 value="close"\
onclick="var panel=document.getElementById(\'%id%\'); if (panel) panel.parentNode.removeChild(panel);">\
</td></tr></table>\
</form>',
//}}}
// // control processing
//{{{
onChangeSource:
function(here) {
var form=here.form;
var list=form.MIMEType;
var theFilename = here.value;
var theExtension = theFilename.substr(theFilename.lastIndexOf('.')).toLowerCase();
// if theFilename is in current document folder, remove path prefix and use relative reference
var h=document.location.href; folder=getLocalPath(decodeURIComponent(h.substr(0,h.lastIndexOf("/")+1)));
if (theFilename.substr(0,folder.length)==folder) theFilename='./'+theFilename.substr(folder.length);
else theFilename='file:///'+theFilename; // otherwise, use absolute reference
theFilename=theFilename.replace(/\\/g,"/"); // fixup: change \ to /
form.useLocal.checked = true;
form.local.value = theFilename;
form.useData.checked = !form.useData.disabled;
list.selectedIndex=1;
for (var i=0; i<list.options.length; i++) // find matching MIME type
if (list.options[i].value.indexOf(theExtension)!=-1) { list.selectedIndex = i; break; }
if (!form.tiddlertitle.disabled)
form.tiddlertitle.value=theFilename.substr(theFilename.lastIndexOf('/')+1); // get tiddlername from filename
},
//}}}
//{{{
onClickAttach:
function (here) {
clearMessage();
// get input values
var form=here.form;
var src=form.source; if (config.browser.isGecko) src=document.getElementById("attachFixSource");
src=src.value!=src.defaultValue?src.value:"";
var when=(new Date()).formatString(config.macros.timeline.dateFormat);
var title=form.tiddlertitle.value;
var local = form.local.value!=form.local.defaultValue?form.local.value:"";
var url = form.URL.value!=form.URL.defaultValue?form.URL.value:"";
var notes = form.notes.value;
var tags = "attachment excludeMissing "+form.tags.value;
var useData=form.useData.checked;
var useLocal=form.useLocal.checked;
var useURL=form.useURL.checked;
var mimetype = form.MIMEType.value.length?form.MIMEType.options[form.MIMEType.selectedIndex].text:"";
// validate checkboxes and get filename
if (useData) {
if (src.length) { if (!theLocation) var theLocation=src; }
else { alert(this.sourceErr); src.focus(); return false; }
}
if (useLocal) {
if (local.length) { if (!theLocation) var theLocation = local; }
else { alert(this.localErr); form.local.focus(); return false; }
}
if (useURL) {
if (url.length) { if (!theLocation) var theLocation = url; }
else { alert(this.URLErr); form.URL.focus(); return false; }
}
if (!(useData||useLocal||useURL))
{ form.useData.focus(); alert(this.storageErr); return false; }
if (!theLocation)
{ src.focus(); alert(this.sourceErr); return false; }
if (!title || !title.trim().length || title==this.titlePrompt)
{ form.tiddlertitle.focus(); alert(this.tiddlerErr); return false; }
// if not already selected, determine MIME type based on filename extension (if any)
if (useData && !mimetype.length && theLocation.lastIndexOf('.')!=-1) {
var theExt = theLocation.substr(theLocation.lastIndexOf('.')).toLowerCase();
var theList=form.MIMEType;
for (var i=0; i<theList.options.length; i++)
if (theList.options[i].value.indexOf(theExt)!=-1)
{ var mimetype=theList.options[i].text; theList.selectedIndex=i; break; }
}
// attach the file
return this.createAttachmentTiddler(src, when, notes, tags, title,
useData, useLocal, useURL, local, url, mimetype);
},
getMIMEType:
function(src,def) {
var ext = src.substr(src.lastIndexOf('.')).toLowerCase();
var list=store.getTiddlerText(this.typeList);
if (!list || !list.trim().length) return def;
// get MIME list content from tiddler
var parts=list.split("\n----\n");
for (var p=0; p<parts.length; p++) {
var lines=parts[p].split("\n");
var mime=lines.shift(); // 1st line=MIME type
var match=lines.shift(); // 2nd line=matching extensions
if (match.indexOf(ext)!=-1) return mime;
}
return def;
},
createAttachmentTiddler:
function (src, when, notes, tags, title, useData, useLocal, useURL, local, url, mimetype, noshow) {
if (useData) { // encode the data
if (!mimetype.length) {
alert(this.MIMEErr);
form.MIMEType.selectedIndex=1; form.MIMEType.focus();
return false;
}
var d = this.readFile(src); if (!d) { return false; }
displayMessage('encoding '+src);
var encoded = this.encodeBase64(d);
displayMessage('file size='+d.length+' bytes, encoded size='+encoded.length+' bytes');
}
var usage=(mimetype.substr(0,5)=="image"?'[img[%0]]':'[[%0|%0]]').format([title]);
var theText=this.tiddlerFormat.format([
usage, notes.length?notes:'//none//', mimetype,
useLocal?local.replace(/\\/g,'/'):'', useURL?url:'',
useData?('data:'+mimetype+';base64,'+encoded):'' ]);
store.saveTiddler(title,title,theText,config.options.txtUserName,new Date(),tags);
var panel=document.getElementById("attachPanel"); if (panel) panel.style.display="none";
if (!noshow) { story.displayTiddler(null,title); story.refreshTiddler(title,null,true); }
displayMessage('attached "'+title+'"');
return true;
},
//}}}
// // base64 conversion
//{{{
encodeBase64:
function (d) {
if (!d) return null;
// encode as base64
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var out="";
var chr1,chr2,chr3="";
var enc1,enc2,enc3,enc4="";
for (var count=0,i=0; i<d.length; ) {
chr1=d.charCodeAt(i++);
chr2=d.charCodeAt(i++);
chr3=d.charCodeAt(i++);
enc1=chr1 >> 2;
enc2=((chr1 & 3) << 4) | (chr2 >> 4);
enc3=((chr2 & 15) << 2) | (chr3 >> 6);
enc4=chr3 & 63;
if (isNaN(chr2)) enc3=enc4=64;
else if (isNaN(chr3)) enc4=64;
out+=keyStr.charAt(enc1)+keyStr.charAt(enc2)+keyStr.charAt(enc3)+keyStr.charAt(enc4);
chr1=chr2=chr3=enc1=enc2=enc3=enc4="";
}
return out;
},
decodeBase64: function(input) {
var out="";
var chr1,chr2,chr3;
var enc1,enc2,enc3,enc4;
var i = 0;
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
input=input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do {
enc1=keyStr.indexOf(input.charAt(i++));
enc2=keyStr.indexOf(input.charAt(i++));
enc3=keyStr.indexOf(input.charAt(i++));
enc4=keyStr.indexOf(input.charAt(i++));
chr1=(enc1 << 2) | (enc2 >> 4);
chr2=((enc2 & 15) << 4) | (enc3 >> 2);
chr3=((enc3 & 3) << 6) | enc4;
out=out+String.fromCharCode(chr1);
if (enc3!=64) out=out+String.fromCharCode(chr2);
if (enc4!=64) out=out+String.fromCharCode(chr3);
} while (i<input.length);
return out;
},
//}}}
// // I/O functions
//{{{
readFile: // read local BINARY file data
function(filePath) {
if(!window.Components) { return null; }
try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
catch(e) { alert("access denied: "+filePath); return null; }
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
try { file.initWithPath(filePath); } catch(e) { alert("cannot read file - invalid path: "+filePath); return null; }
if (!file.exists()) { alert("cannot read file - not found: "+filePath); return null; }
var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream);
inputStream.init(file, 0x01, 00004, null);
var bInputStream = Components.classes["@mozilla.org/binaryinputstream;1"].createInstance(Components.interfaces.nsIBinaryInputStream);
bInputStream.setInputStream(inputStream);
return(bInputStream.readBytes(inputStream.available()));
},
//}}}
//{{{
writeFile:
function(filepath,data) {
// TBD: decode base64 and write BINARY data to specified local path/filename
return(false);
},
//}}}
//{{{
askForFilename: // for FF3 fixup
function(target) {
var msg=config.messages.selectFile;
if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text
// get local path for current document
var path=getLocalPath(document.location.href);
var p=path.lastIndexOf("/"); if (p==-1) p=path.lastIndexOf("\\"); // Unix or Windows
if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash
var file=""
var result=window.mozAskForFilename(msg,path,file,true); // FF3 FIXUP ONLY
if (target && result.length) // set target field and trigger handling
{ target.value=result; target.onchange(); }
return result;
}
};
//}}}
//{{{
if (window.mozAskForFilename===undefined) { // also defined by CoreTweaks (for ticket #604)
window.mozAskForFilename=function(msg,path,file,mustExist) {
if(!window.Components) return false;
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
if (picker.show()!=nsIFilePicker.returnCancel)
var result=picker.file.path;
}
catch(ex) { displayMessage(ex.toString()); }
return result;
}
}
//}}}
/***
|Name|AttachFilePluginFormatters|
|Source|http://www.TiddlyTools.com/#AttachFilePluginFormatters|
|Version|4.0.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1.3|
|Type|plugin|
|Description|run-time library for displaying attachment tiddlers|
Runtime processing for //rendering// attachment tiddlers created by [[AttachFilePlugin]]. Attachment tiddlers are tagged with<<tag attachment>>and contain binary file content (e.g., jpg, gif, pdf, mp3, etc.) that has been stored directly as base64 text-encoded data or can be loaded from external files stored on a local filesystem or remote web server. Note: after creating new attachment tiddlers, you can remove [[AttachFilePlugin]], as long as you retain //this// tiddler (so that images can be rendered later on).
!!!!!Formatters
<<<
This plugin extends the behavior of the following TiddlyWiki core "wikify()" formatters:
* embedded images: {{{[img[tooltip|image]]}}}
* linked embedded images: {{{[img[tooltip|image][link]]}}}
* external/"pretty" links: {{{[[label|link]]}}}
''Please refer to AttachFilePlugin (source: http://www.TiddlyTools.com/#AttachFilePlugin) for additional information.''
<<<
!!!!!Revisions
<<<
2009.10.10 [4.0.1] in fileExists(), check for IE to avoid hanging Chrome during startup
2009.06.04 [4.0.0] changed attachment storage format to use //sections// instead of embedded substring markers.
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.10.29 [3.7.0] more code reduction: removed upload handling from AttachFilePlugin (saves ~7K!)
2007.10.28 [3.6.0] removed duplicate formatter code from AttachFilePlugin (saves ~10K!) and updated documentation accordingly. This plugin ([[AttachFilePluginFormatters]]) is now //''required''// in order to display attached images/binary files within tiddler content.
2006.05.20 [3.4.0] through 2007.03.01 [3.5.3] sync with AttachFilePlugin
2006.05.13 [3.2.0] created from AttachFilePlugin v3.2.0
<<<
!!!!!Code
***/
// // version
//{{{
version.extensions.AttachFilePluginFormatters= {major: 4, minor: 0, revision: 1, date: new Date(2009,10,10)};
//}}}
//{{{
if (config.macros.attach==undefined) config.macros.attach= { };
//}}}
//{{{
if (config.macros.attach.isAttachment==undefined) config.macros.attach.isAttachment=function (title) {
var tiddler = store.getTiddler(title);
if (tiddler==undefined || tiddler.tags==undefined) return false;
return (tiddler.tags.indexOf("attachment")!=-1);
}
//}}}
//{{{
// test for local file existence - returns true/false without visible error display
if (config.macros.attach.fileExists==undefined) config.macros.attach.fileExists=function(f) {
if(window.Components) { // MOZ
try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); }
catch(e) { return false; } // security access denied
var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
try { file.initWithPath(f); }
catch(e) { return false; } // invalid directory
return file.exists();
}
else if (config.browser.isIE) { // IE
var fso = new ActiveXObject("Scripting.FileSystemObject");
return fso.FileExists(f);
}
else return true; // other browsers: assume file exists
}
//}}}
//{{{
if (config.macros.attach.getAttachment==undefined) config.macros.attach.getAttachment=function(title) {
// extract embedded data, local and remote links (if any)
var text=store.getTiddlerText(title,'');
var embedded=store.getTiddlerText(title+'##data','').trim();
var locallink=store.getTiddlerText(title+'##file','').trim();
var remotelink=store.getTiddlerText(title+'##url','').trim();
// backward-compatibility for older attachments (pre 4.0.0)
var startmarker="---BEGIN_DATA---\n";
var endmarker="\n---END_DATA---";
var pos=0; var endpos=0;
if ((pos=text.indexOf(startmarker))!=-1 && (endpos=text.indexOf(endmarker))!=-1)
embedded="data:"+(text.substring(pos+startmarker.length,endpos)).replace(/\n/g,'');
if ((pos=text.indexOf("/%LOCAL_LINK%/"))!=-1)
locallink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));
if ((pos=text.indexOf("/%REMOTE_LINK%/"))!=-1)
remotelink=text.substring(text.indexOf("|",pos)+1,text.indexOf("]]",pos));
// if there is a data: URI defined (not supported by IE)
if (embedded.length && !config.browser.isIE) return embedded;
// document is being served remotely... use remote URL (if any) (avoids security alert)
if (remotelink.length && document.location.protocol!="file:")
return remotelink;
// local link only... return link without checking file existence (avoids security alert)
if (locallink.length && !remotelink.length)
return locallink;
// local link, check for file exist... use local link if found
if (locallink.length) {
locallink=locallink.replace(/^\.[\/\\]/,''); // strip leading './' or '.\' (if any)
if (this.fileExists(getLocalPath(locallink))) return locallink;
// maybe local link is relative... add path from current document and try again
var pathPrefix=document.location.href; // get current document path and trim off filename
var slashpos=pathPrefix.lastIndexOf("/"); if (slashpos==-1) slashpos=pathPrefix.lastIndexOf("\\");
if (slashpos!=-1 && slashpos!=pathPrefix.length-1) pathPrefix=pathPrefix.substr(0,slashpos+1);
if (this.fileExists(getLocalPath(pathPrefix+locallink))) return locallink;
}
// no embedded data, no local (or not found), fallback to remote URL (if any)
if (remotelink.length) return remotelink;
// attachment URL doesn't resolve, just return input as is
return title;
}
//}}}
//{{{
if (config.macros.attach.init_formatters==undefined) config.macros.attach.init_formatters=function() {
if (this.initialized) return;
// find the formatter for "image" and replace the handler
for (var i=0; i<config.formatters.length && config.formatters[i].name!="image"; i++);
if (i<config.formatters.length) config.formatters[i].handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) // Simple bracketted link
{
var e = w.output;
if(lookaheadMatch[5])
{
var link = lookaheadMatch[5];
// ELS -------------
var external=config.formatterHelpers.isExternalLink(link);
if (external)
{
if (config.macros.attach.isAttachment(link))
{
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title = config.macros.attach.linkTooltip + link;
}
else
e = createExternalLink(w.output,link);
}
else
e = createTiddlyLink(w.output,link,false,null,w.isStatic);
// ELS -------------
addClass(e,"imageLink");
}
var img = createTiddlyElement(e,"img");
if(lookaheadMatch[1])
img.align = "left";
else if(lookaheadMatch[2])
img.align = "right";
if(lookaheadMatch[3])
img.title = lookaheadMatch[3];
img.src = lookaheadMatch[4];
// ELS -------------
if (config.macros.attach.isAttachment(lookaheadMatch[4]))
img.src=config.macros.attach.getAttachment(lookaheadMatch[4]);
// ELS -------------
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
//}}}
//{{{
// find the formatter for "prettyLink" and replace the handler
for (var i=0; i<config.formatters.length && config.formatters[i].name!="prettyLink"; i++);
if (i<config.formatters.length) {
config.formatters[i].handler=function(w) {
this.lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = this.lookaheadRegExp.exec(w.source);
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var e;
var text = lookaheadMatch[1];
if(lookaheadMatch[3]) {
// Pretty bracketted link
var link = lookaheadMatch[3];
if (config.macros.attach.isAttachment(link)) {
e = createExternalLink(w.output,link);
e.href=config.macros.attach.getAttachment(link);
e.title=config.macros.attach.linkTooltip+link;
}
else e = (!lookaheadMatch[2] && config.formatterHelpers.isExternalLink(link))
? createExternalLink(w.output,link)
: createTiddlyLink(w.output,link,false,null,w.isStatic);
} else {
e = createTiddlyLink(w.output,text,false,null,w.isStatic);
}
createTiddlyText(e,text);
w.nextMatch = this.lookaheadRegExp.lastIndex;
}
}
} // if "prettyLink" formatter found
this.initialized=true;
}
//}}}
//{{{
config.macros.attach.init_formatters(); // load time init
//}}}
//{{{
if (TiddlyWiki.prototype.coreGetRecursiveTiddlerText==undefined) {
TiddlyWiki.prototype.coreGetRecursiveTiddlerText = TiddlyWiki.prototype.getRecursiveTiddlerText;
TiddlyWiki.prototype.getRecursiveTiddlerText = function(title,defaultText,depth) {
return config.macros.attach.isAttachment(title)?
config.macros.attach.getAttachment(title):this.coreGetRecursiveTiddlerText.apply(this,arguments);
}
}
//}}}
/***
|Name|AttachFilePluginInfo|
|Source|http://www.TiddlyTools.com/#AttachFilePlugin|
|Documentation|http://www.TiddlyTools.com/#AttachFilePluginInfo|
|Version|4.0.0|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|Documentation for AttachFilePlugin|
Store or link binary files (such as jpg, gif, pdf or even mp3) within your ~TiddlyWiki document and then use them as images or links from within your tiddler content.
!!!!!Inline interface (live)
>see [[AttachFile]] (shadow tiddler)
><<tiddler AttachFile>>
!!!!!Syntax
<<<
''To display the attach file control panel, simply view the [[AttachFile]] shadow tiddler that is automatically created by the plugin, and contains an instance of the inline control panel.''. Or, you can write:
{{{
<<attach inline>>
}}}
in any tiddler to display the control panel embedded within that tiddler. Note: you can actually use any unique identifier in place of the "inline" keyword. Each unique id creates a separate instance of the controls. If the same ID is used in more than one tiddler, then the control panel is automatically moved to the most recently rendered location. Or, you can write:
{{{
<<attach>>
}}}
(with no ID parameter) in ~SidebarOptions. This adds a command link that opens the controls as a floating panel, positioned directly to the left of the sidebar.
<<<
!!!!!Usage
<<<
Binary file content can be stored in three different locations:
#embedded in the attachment tiddler (encoded as base64)
#on your filesystem (a 'local link' path/filename)
#on a web server (a 'remote link' URL)
The plugin creates an "attachment tiddler" for each file you attach. Regardless of where you store the binary content, your document can refer to the attachment tiddler rather than using a direct file or URL reference in your embedded image or external links, so that changing document locations will not require updating numerous tiddlers or copying files from one system to another.
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the ~TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
When you attach a file, a tiddler (tagged with<<tag attachment>>) is generated (using the source filename as the tiddler's title). The tiddler contains //''base64 text-encoded binary data''//, surrounded by {{{/%...%/}}} comment markers (so they are not visible when viewing the tiddler). The tiddler also includes summary details about the file: when it was attached, by whom, etc. and, if the attachment is an image file (jpg, gif, or png), the image is automatically displayed below the summary information.
>Note: although you can edit an attachment tiddler, ''don't change any of the encoded content below the attachment header'', as it has been prepared for use in the rest of your document, and even changing a single character can make the attachment unusable. //If needed, you ''can'' edit the header information or even the MIME type declaration in the attachment data, but be very careful not to change any of the base64-encoded binary data.//
Unfortunately, embedding just a few moderately-sized binary files using base64 text-encoding can dramatically increase the size of your document. To avoid this problem, you can create attachment tiddlers that define external local filesystem (file://) and/or remote web server (http://) 'reference' links, without embedding the binary data directly in the tiddler (i.e., uncheck "embed data" in the 'control panel').
These links provide an alternative source for the binary data: if embedded data is not found (or you are running on Internet Explorer, which does not currently support using embedded data), then the plugin tries the local filesystem reference. If a local file is not found, then the remote reference (if any) is used. This "fallback" approach also lets you 'virtualize' the external links in your document, so that you can access very large binary content such as ~PDFs, ~MP3's, and even *video* files, by using just a 'remote reference link' without embedding any data or downloading huge files to your hard disk.
Of course, when you //do// download an attached file, the local copy will be used instead of accessing a remote server each time, thereby saving bandwidth and allowing you to 'go mobile' without having to edit any tiddlers to alter the link locations...
<<<
!!!!!Syntax / Examples
<<<
To embed attached files as images or link to them from other tiddlers, use the standard ~TiddlyWiki image syntax ({{{[img[tooltip|filename]]}}}), linked image syntax ({{{[img[tooltip|filename][tiddlername]]}}}) , or "external link" syntax ({{{[[text|URL]]}}}), replacing the filename or URL that is normally entered with the title of an attachment tiddler.
embedded image data:
>{{{[img[Meow|TraceLog Dialog.png]]}}}
>[img[Meow|TraceLog Dialog.png]]
embedded image data with link to larger remote image:
>{{{[img[click for larger view|TraceLog Dialog.png][TraceLog Dialog.png]]}}}
>[img[click for larger view|TraceLog Dialog.png][TraceLog Dialog.png]]
'external' link to embedded image data:
>{{{[[click to view attachment|TraceLog Dialog.png]]}}}
>[[click to view attachment|TraceLog Dialog.png]]
'external' link to remote image:
>{{{[[click to view attachment|TraceLog Dialog.png]]}}}
>[[click to view attachment|TraceLog Dialog.png]]
regular ~TiddlyWiki links to attachment tiddlers:
>{{{[[TraceLog Dialog.png]]}}} [[TraceLog Dialog.png]]
>{{{[[TraceLog Dialog.png]]}}} [[TraceLog Dialog.png]]
<<<
!!!!!Defining MIME types
<<<
When you select a source file, a ''[[MIME|http://en.wikipedia.org/wiki/MIME]]'' file type is automatically suggested, based on filename extension. The AttachFileMIMETypes tiddler defines the list of MIME types that will be recognized by the plugin. Each MIME type definition consists of exactly two lines of text: the official MIME type designator (e.g., "text/plain", "image/gif", etc.), and a space-separated list of file extensions associated with that type. List entries are separated by "----" (horizontal rules).
<<<
!!!!!Known Limitations
<<<
Internet Explorer does not support the data: URI scheme, and cannot use the //embedded// data to render images or links. However, you can still use the local/remote link definitions to create file attachments that are stored externally. In addition, while it is relatively easy to read local //text// files, reading binary files is not directly supported by IE's ~FileSystemObject (FSO) methods, and other file I/O techniques are subject to security barriers or require additional MS proprietary technologies (like ASP or VB) that make implementation more difficult. As a result, you cannot //create// new attachment tiddlers using IE.
<<<
!!!!!Installation
<<<
Import (or copy/paste) the following tiddlers into your document:
* [[AttachFilePlugin]] (tagged with <<tag systemConfig>>)
* [[AttachFilePluginFormatters]] ("runtime distribution library") (tagged with <<tag systemConfig>>)
* ~TraceLog Dialog.png and ~TraceLog Dialog.png //(tagged with <<tag attachment>>)//
* [[AttachFileMIMETypes]] //(defines binary file types)//
> Important note: As of version 3.6.0, in order to //render// images and other binary attachments created with this plugin, you must also install [[AttachFilePluginFormatters]], which extends the behavior of the ~TiddlyWiki core formatters for embedded images ({{{[img[tooltip|image]]}}}), linked embedded images ({{{[img[tooltip|image][link]]}}}), and external/"pretty" links ({{{[[label|link]]}}}), so that these formatter will process references to attachment tiddlers as if a normal file reference had been provided. |
<<<
!!!!!Revisions
<<<
2009.06.04 4.0.0 changed attachment storage format to use //sections// instead of embedded substring markers.
2008.07.21 3.9.0 Fixup for ~FireFox 3: use HTML with separate text+button control instead of type='file' control
2008.05.12 3.8.1 automatically add 'attach' task to backstage (moved from ~BackstageTweaks)
2008.04.09 3.8.0 in onChangeSource(), if source matches current document folder, use relative reference for local link. Also, disable 'embed' when using IE (which //still// doesn't support data: URI)
2008.04.07 3.7.3 fixed typo in HTML for 'local file link' so that clicking in input field doesn't erase current path/file (if any)
2008.04.07 3.7.2 auto-create AttachFile shadow tiddler for inline interface
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info
2007.12.04 [*.*.*] update for ~TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.12.03 3.7.1 in createAttachmentTiddler(), added optional "noshow" flag to suppress display of newly created tiddlers.
2007.10.29 3.7.0 code reduction: removed support for built-in upload to server... on-line hosting of binary attachments is left to the document author, who can upload/host files using 3rd-party web-based services (e.g. www.flickr.com, ) or stand-alone applications (e.g., FTP).
2007.10.28 3.6.0 code reduction: removed duplicate definition of image and prettyLink formatters. Rendering of attachment tiddlers now //requires// installation of AttachFilePluginFormatters
2007.03.01 3.5.3 use apply() to invoke hijacked function
2007.02.25 3.5.2 in hijack of "prettyLink", fix version check for ~TW2.2 compatibility (prevent incorrect use of fallback handler)
2007.01.09 3.5.1 onClickAttach() refactored to create separate createAttachmentTiddler() API for use with ~FileDropPluginHandlers
2006.11.30 3.5.0 in getAttachment(), for local references, add check for file existence and fallback to remote URL if local file not found. Added fileExists() to encapsulate FF vs. IE local file test function (IE FSO object code is TBD).
2006.11.29 3.4.8 in hijack for ~PrettyLink, 'simple bracketed link' opens tiddler instead of external link to attachment
2006.11.29 3.4.7 in readFile(), added try..catch around initWithPath() to handle invalid/non-existent paths better.
2006.11.09 3.4.6 REAL FIX for ~TWv2.1.3: incorporate new ~TW2.1.3 core "prettyLink" formatter regexp handling logic and check for version < 2.1.3 with fallback to old plugin code. Also, cleanup table layout in HTML (added "border:0" directly to table elements to override stylesheet)
2006.11.08 3.4.5 TEMPORARY FIX for ~TWv2.1.3: disable hijack of wikiLink formatter due to changes in core wikiLink regexp definition. //Links to attachments are broken, but you can still use {{{[img[TiddlerName]]}}} to render attachments as images, as well as {{{background:url('[[TiddlerName]]')}}} in CSS declarations for background images.//
2006.09.10 3.4.4 update formatters for 2.1 compatibility (use this.lookaheadRegExp instead of temp variable)
2006.07.24 3.4.3 in prettyLink formatter, added check for isShadowTiddler() to fix problem where shadow links became external links.
2006.07.13 3.4.2 in getAttachment(), fixed stripping of newlines so data: used in CSS will work
2006.05.21 3.4.1 in getAttachment(), fixed substring() to extract data: URI (was losing last character, which broken rendering of SOME images)
2006.05.20 3.4.0 hijack core getRecursiveTiddlerText() to support rendering attachments in stylesheets (e.g. {{{url([[TraceLog Dialog.png]])}}})
2006.05.20 3.3.6 add "description" feature to easily include notes in attachment tiddler (you can always edit to add them later... but...)
2006.05.19 3.3.5 add "attach as" feature to change default name for attachment tiddlers. Also, new optional param to specify tiddler name (disables editing)
2006.05.16 3.3.0 completed ~XMLHttpRequest handling for GET or POST to configurable server scripts
2006.05.13 3.2.0 added interface for upload feature. Major rewrite of code for clean object definitions. Major improvements in UI interaction and validation.
2006.05.09 3.1.1 add wikifer support for using attachments in links from "linked image" syntax: {{{[img[tip|attachment1][attachment2]]}}}
2006.05.09 3.1.0 lots of code changes: new options for attachments that use embedded data and/or links to external files (local or remote)
2006.05.03 3.0.2 added {{{/%...%/}}} comments around attachment data to hide it when viewing attachment tiddler.
2006.02.05 3.0.1 wrapped wikifier hijacks in initAttachmentFormatters() function to eliminate globals and avoid ~FireFox 1.5.0.1 crash bug when referencing globals
2005.12.27 3.0.0 Update for ~TW2.0. Automatically add 'excludeMissing' tag to attachments
2005.12.16 2.2.0 Dynamically create/remove attachPanel as needed to ensure only one instance of interface elements exists, even if there are multiple instances of macro embedding.
2005.11.20 2.1.0 added wikifier handler extensions for "image" and "prettyLink" to render tiddler attachments
2005.11.09 2.0.0 begin port from old ELS Design adaptation based on ~TW1.2.33
2005.07.20 1.0.0 Initial release (as adaptation)
<<<
The //~BackColor// property specifies or determines the color (RGB) of the Control's background.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~GroupBox<br />~HiddenControl<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.BackColor}}}
{{{getBackColor(}}}//control//{{{)}}}
{{{setBackColor(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Long}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~BackColor' not applicable in this context |
!!!See also
[[BorderColor]]
[[BorderStyle]]
[[ForeColor]]
!!!Example
<<tiddler "Color example">>
The //~BorderColor// property specifies or determines the color (RGB) of a Control's border.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~CheckBox<br />~CommandButton<br />~GroupBox<br />~HiddenControl<br />~NavigationBar<br />[[RadioButton]]<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.BorderColor}}}
{{{getBorderColor(}}}//control//{{{)}}}
{{{setBorderColor(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Long}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~BorderColor' not applicable in this context |
!!!See also
[[BackColor]]
[[BorderStyle]]
[[ForeColor]]
!!!Example
<<tiddler "Color example">>
The //~BorderStyle// property specifies or determines the style (normal, 3D) of a Control's border.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~CheckBox<br />~CommandButton<br />~GroupBox<br />~HiddenControl<br />[[RadioButton]]<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.BorderStyle}}}
{{{getBorderStyle(}}}//control//{{{)}}}
{{{setBorderStyle(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Integer}}}
!!!Remarks
The allowed values for ~BorderStyle are:
>0: No border
>1: 3D border
>2: simple border
!!!Error messages
|Argument nr.X is invalid |
|Property '~BorderStyle' not applicable in this context |
|Value '...' is invalid for property '~BorderStyle' |
!!!See also
[[BorderColor]]
!!!Example
<<tiddler "Color example">>
The //Cancel// property specifies if a command button has or not the behaviour of a Cancel button.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |~CommandButton | None |A control on an open form |
!!!Syntax
//control//{{{.Cancel}}}
{{{getCancel(}}}//control//{{{)}}}
{{{setCancel(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property 'Cancel' not applicable in this context |
!!!See also
[[Default]]
!!!Example
<<tiddler "Cancel & Default example">>
Display the status of a command button
//{{{
Dim ocControl As Object
Set ocControl = getObject("Forms!myForm!cmdButton")
MsgBox "Cancel=" & getCancel(ocControl) & " - Default=" & getDefault(ocControl)
//}}}
The //Caption// property specifies the text string appearing in the title bar of a [[form|Form]].
When related to a [[Control]] the //Caption// property refers to the text associated with the control.
When the control belongs to a [[GridControl]] the //Caption// property specifies the column header.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Form]] |||An open form |
|[[Control]] | ~CheckBox<br />~CommandButton<br />~FixedText<br />~GroupBox<br />[[RadioButton]] | All |A control on an open form or within a [[GridControl]] of one of the listed types |
!!!Syntax
//form//{{{.Caption}}}
{{{getCaption(}}}//form//{{{)}}}
{{{setCaption(}}}//form//{{{,}}}//value//{{{)}}}
//control//{{{.Caption}}}
{{{getCaption(}}}//control//{{{)}}}
{{{setCaption(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{String}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!Examples
<<tiddler "Caption examples">>
Display and change form title bar
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
MsgBox ofForm.Caption
setCaption(ofForm, "New title")
//}}}
Change a checkbox label
//{{{
Dim ocCheckBox As Object
ocCheckBox = getObject("Forms!myForm!myChkBox")
If ocCheckBox.Value Then
setCaption(ocCheckBox, "Checked")
Else
setCaption(ocCheckbox, "Unchecked")
End If
//}}}
{{firstletter{
@@color:#930;T@@
}}}he //Close// [[action|Actions]] closes an object (table, query, form or report).
!!!Syntax
{{{mClose(}}}//{{{ObjectType, ObjectName, Save}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{ObjectType}}} | No | acTable<br />acQuery<br />acForm<br />acReport |The type of object to close. |
|{{{ObjectName}}} | No | String |The name of the object to close. This argument is NOT case-sensitive. |
|{{{Save}}} | Yes | acSavePrompt |Indicates if a prompt to the user will prevent from closing without saving. acSavePrompt is the only supported value. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acForm = 2
Global Const acQuery = 1
Global Const acReport = 3
Global Const acTable = 0
Global Const acSavePrompt = 0
//}}}
!!!Remarks
*The {{{ObjectName}}} object must exist in the database document (".odb" file). However if it is not open, the command has no effect.
*If the object is a table or a query, and the object is not open, running the //Close// action will open the Table or Query and close it immediately.
!!!Error messages
|Table (or form or query or report) '...' could not be closed |
|Table (or form or query or report) '...' not found |
!!!See also
[[OpenForm]]
[[OpenQuery]]
[[OpenReport]]
[[OpenTable]]
!!!Example
//{{{
mClose(acTable, "myTable")
//}}}
This page details the conventions used in the coding of the //~Access2Base// API.
!!Library and Modules
*The acConstants module lists constants that are used in the API. They are defined as //Global//. Their name is identical as in ~MSAccess. Their value is in most cases identical to that of ~MSAccess, however not always. The scope of global constants is limited to one single library. As a consequence their definition may freely be copied and pasted to make them available in user libraries.
*The reserved words are //~Proper-Cased// showing the same appearance as in the IDE of ~MSAccess.
!!Functions and Subroutines
*~OpenOffice/~LibreOffice ignores the Private/Public attribute in Functions or Subs declarations. Nevertheless the attribute must be present. Rules for use are:
| !Attribute | !Sub/Function Naming | !When |
|Public |Starts with a letter |The Sub/Function belongs to the ~Access2Base API. As such it may be called from any other library developed by the user. |
|Public |Starts with an underscore "_" |The Sub/Function must be called only from within the ~Access2Base library. As such it MUST NOT be called from another library as there is no guarantee about the arguments, the logic or even the existence of that piece of code in a later release. |
|Private |The Sub/Function must start with an underscore "_" |The Sub/Function must be called only from the module in which it is located |
*Functions and Subroutines belonging to the API (= "standard" functions/Subs) are stored in their module in alphabetical order.
*Functions and Subroutines not belonging to the API are stored in their module in alphabetical order below the standard ones.
*The return value of a function is always declared explicitly.
*The parameters are always declared explicitly even if they're variants.
*The Function and Sub declarations start at the 1^^st^^ column of the line.
*The End Function/Sub statement is followed by a comment reminding the name of the function or sub.
!!Variable declarations
*The //Option Explicit// statement is mandatory in every module.
*The Global, Dim and Const statements always start in the first column of the line.
*The type (Dim ... As ...) is always declared explicitly, even if the type is Variant.
*Variables are //~Proper-Cased//. They are always preceded by a lower-case letter indicating their type. With next exception: if declared, variables i, j, k, l, m and n must be integers.
| !First letter | !Type |
| b |Boolean |
| v |Variant |
| o |Object |
| i |Integer |
| l |Long|
| s |String |
{{indent{Example:{{{ Dim sValue As String}}}
*Parameters are preceded by the letter //p// which itself precedes the single typing letter. Like in:<br />{{{Public Function MyFunction(psValue As String) As Variant}}}
*Pseudo-objects variables are preceded by the letter o (for object) followed by their pseudo-type:
| !First letter | !~Pseudo-Type |
| db |Database |
| f |Form or Subform |
| c |Control |
| e |Event |
| p |Property |
{{indent{like in:{{{ Dim ocControl As Object}}}
*Global variables in the ~Access2Base library are ALL preceded by an underscore "_" as NONE of them should be invoked from outside the library.
*Constant values with a local scope are //~Proper-Cased// and preceded by the letters //cst//.
*Constants with a global scope are //~UPPER-CASED//
Example
//{{{
Global Const ACONSTANT = "This is a global constant"
Function MyFunction(pocControl As Object, piValue) As Variant
Dim iValue As Integer
Const cstMyConstant = 3
//}}}
!Goto
The //Goto// statement is forbidden.
It is however highly recommended for __error__ and __exception__ handling.
A //Collection// contains a list of other pseudo-objects.
The individual members of the collection are accessible either via their index or via their name. The name is NOT case-sensitive.
!!!Collections
A //Collection// pseudo-object is returned by next functions
| !Function |!Description |
|[[AllForms]] |{{{AllForms()}}} without argument returns the //Collection// of all forms defined in the current Base document |
|[[Forms]] |{{{Forms()}}} without argument returns the //Collection// of all open forms |
|[[Controls]] |{{{Controls(myFormObject)}}} returns the //Collection// of all the controls of a //form//, a //subform// or a //gridcontrol// designated by the object //myFormObject// |
|[[Properties]] |{{{Properties(myObject)}}} returns the //Collection// of all properties of the object //myObject// |
!!!Properties
| !Property |!Description |
|[[Count]] |Number of items in the //Collection//. The first item of the //Collection// has the range //0//; the last one has the range //Count - 1// |
!!!Methods
None
!!!Example
<<tiddler "Collection example">>
To display the name of all forms
//{{{
Dim i As Integer, oCollection As Object
Set oCollection = AllForms
For i = 0 To oCollection.Count - 1 'AllForms without argument returns a Collection object
Print AllForms(i).pName, 'AllForms(...) with an argument returns a Form object
Next i
Print
//}}}
Modify colors depending on value in field (typically in After Record Change form event)
//{{{
Dim ocControl As Object, vValue As Variant
Dim lBlack As Long, lRed As Long, lYellow As Long, lWhite As Long
Set ocControl = getObject("Forms!myForm!myControl")
vValue = getValue(ocControl)
If Not IsNull(vValue) Then
lRed = RGB(255, 0, 0)
lBlack = RGB(0, 0, 0)
lYellow = RGB(255, 255, 0)
lWhite = RGB(255, 255, 255)
If vValue > 100 Then
setBorderColor(ocControl, lRed)
setForeColor(ocControl, lRed)
setBackColor(ocControl, lYellow)
setBorderStyle(ocControl, 2)
Else
setBorderColor(ocControl, lBlack)
setForeColor(ocControl, lBlack)
setBackColor(ocControl, lWhite)
setBorderStyle(ocControl, 0)
End If
End If
//}}}
{{firstletter{
@@color:#930;A@@
}}} //~ComboBox// describes a combo box control. It has specific properties to manage the input list of potential values and to select one of them programmatically.
A ~ComboBox control is returned by the [[Controls]] collection or by the [[getObject]] shortcut.
!!!Specific properties for combo box management
| !Property | !Type | !Read only | !Description |
|[[ItemData]] || Y |Returns the data for the specified row in a ~ComboBox or [[ListBox]]. |
|[[ListCount]] || Y |Determines the number of rows in a [[ListBox]] or the list box portion of a ~ComboBox. |
|[[ListIndex]] |||Determines which item is selected in a [[ListBox]] or a ~ComboBox. |
|[[RowSource]] |||Specifies the source of the data in a [[ListBox]] or a ~ComboBox. |
|[[RowSourceType]] |||Specifies the source (tablename, queryname or SQL statement) of the data in a [[ListBox]] or a ~ComboBox. |
|[[Value]] |||Specifies the value contained in the ~ComboBox. |
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the ~ComboBox has the given property. |
|[[Requery]] || Boolean |True if data reloaded in ~ComboBox |
!!!Remarks
!!!See also
[[ListBox]]
!!!Example
<<tiddler "ComboBox example">>
//{{{
REM Display the options of the combo
Dim i As Integer, ocCombo As Object
Set ocCombo = getObject("Forms!myForm!myComboBox")
For i = 0 To ocCombo.ListCount - 1
Print i & " - " & ocCombo.ItemData(i),
Next i
REM Modify current selection position and find new value
setListIndex(ocCombo, 2)
Print getValue(ocCombo),
Print
//}}}
{{firstletter{
@@color:#930;A@@
}}} //Control// [[Pseudo-Object|Pseudo Object]] describes one of the Controls of an open form, a subform or a gridcontrol. Each control will be retrieved as a member of the [[Controls]] [[collection|Collection]] of its corresponding parent.
NB: Subforms and gridcontrols are themselves controls and retrieved like other controls as a member of a collection.
!!!Functions returning a control pseudo-object
| !Function | !Type | !Arguments |!Description |
|[[Controls]] | [[Collection]] | Parent object<br />Integer or String |{{{Controls("myForm","myControl")}}} returns a pseudo-object corresponding with the {{{myControl}}} control in the {{{myForm}}} form. {{{myForm}}} must be open. |
|[[getObject]] || String |{{{getObject("Forms!myForm!myControl")}}} returns a pseudo-object corresponding with the {{{myControl}}} control in the {{{myForm}}} form. {{{myForm}}} must be open. |
!!!Control types
The types of control can be recognized thru the use either of the [[SubType]] or the [[ControlType]] properties. The ~ControlType property is there for compatibility with ~MSAccess but has the disadvantage to not discriminate control types 100%, e.g. a ~TextField cannot be distinguished from a ~FormattedField control type.
See the correspondence table below.
<<tiddler "ControlTypesList">>
!!!Properties
| !Property | !Type | !Read only |!Description or UNO object |
|[[Name]] || Y |Specifies the exact name of the control |
|BackColor (*) |||Specifies the color of the interior of a control. |
|BorderColor (*) |||Specifies the color of a control's border. |
|BorderStyle (*) |||Specifies how a control's border appears. |
|[[Cancel]] (*) |||Specifies whether a command button is also the Cancel button on a form. |
|[[Caption]] |||Specifies the label associated with a control.<br />If the control is located within a ~GridControl, the Caption specifies the column heading. |
|[[ControlSource]] || Y |Specifies what data appears in a control. |
|[[ControlTipText]] |||Specifies the text that appears in a ~ScreenTip when you hold the mouse pointer over a control. |
|[[ControlType]] || Y |Specifies the type of a control. |
|[[Default]] (*) |||specifies whether a ~CommandButton is the default button on a form. |
|[[DefaultValue]] |||Specifies a value that is automatically entered in a field when a new record is created. |
|[[Enabled]] |||Specifies if the cursor can access the control. |
|[[FontBold]]<br />[[FontItalic]]<br />[[FontName]]<br />[[FontSize]]<br />[[FontUnderline]]<br />[[FontWeight]]<br />[[ForeColor]]<br />(*) |||Specify the font characteristics. |
|[[Form|Form (subform)]] (*) || Y |Returns the [[SubForm]] object corresponding with the ~SubForm control. |
|[[Format]] || Y |Returns the way numbers, dates, times, and text are displayed |
|[[ItemData]] || Y |Returns the data for the specified row in a combo box or list box. |
|[[ListCount]] || Y |Determines the number of rows in a [[ListBox]] or the list box portion of a [[ComboBox]]. |
|[[ListIndex]] |||Determines which item is selected in a [[ListBox]] or a [[ComboBox]]. |
|[[Locked]] |||Specifies whether you can edit data in a control. |
|[[MultiSelect]] (*) |||Specifies whether a user can make multiple selections in a [[ListBox]] on a form. |
|[[OptionValue]] (*) || Y |Specifies the value that is stored in the database when a [[RadioButton]] is selected and the record saved. |
|[[Required]] |||Specifies whether a control must contain a value when the record is edited. |
|[[RowSource]] |||Specifies the source of the data in a [[ListBox]] or a [[ComboBox]]. |
|[[RowSourceType]] |||Specifies the source (tablename, queryname or SQL statement) of the data in a [[ListBox]] or a [[ComboBox]]. |
|[[Selected]] |||Specifies if an item in the data proposed by a [[ListBox]] is currently selected. |
|[[SubType]] || Y |Specifies the type of a control. |
|[[TabIndex]] (*) |||Specifies a control's place in the tab order on a form. |
|[[TabStop]] (*) |||Specifies whether you can use the TAB key to move the focus to a control. |
|[[Tag]] |||Stores extra information about a control. |
|[[Text]] || Y |Sets or returns the text contained in a text box (or similar). |
|[[TextAlign]] |||Specifies the alignment of the text in a control. |
|[[TripleState]] |||Specifies how a //~CheckBox// wll display Null values. |
|[[Value]] |||Specifies the value contained in a control. |
|[[Visible]] (*) |||Specifies if a control is visible or hidden. |
|~ControlModel | UNO | Y |com.sun.star.comp.forms.~XXXModel |
|~ControlView | UNO | Y |com.sun.star.comp.forms.~XXXControl |
|~BoundField | UNO | Y |com.sun.star.sdb.~ODataColumn |
|~LabelControl | UNO | Y |com.sun.star.form.component.~FixedText or com.sun.star.form.component.~GroupBox |
(*) Not applicable to controls belonging to a [[GridControl]].
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the Control has the given property. |
|[[setFocus]] | none | Boolean |Return True if focus set on Control successfully. |
!!!Remarks
!!!Example
<<tiddler "Control example">>
List all the controls of a form which do not have the Visible property
//{{{
Dim ofForm As Object, ocControl As Object, i As Integer, iCount As Integer
Set ofForm = Forms("myForm")
iCount = Controls(ofForm).Count
For i = 0 To iCount - 1
Set ocControl = Controls(ofForm, i)
If Not hasProperty(ocControl, "Visible") Then Print ocControl.pName & ":" & ocControl.SubType,,
Next i
Print
//}}}
The //~ControlSource// property specifies the database field bound to the [[Control]].
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | ~CheckBox<br />~ComboBox<br />~CurrencyField<br />~DateField<br />~FormattedField<br />~ImageControl<br />[[ListBox]]<br />~NumericField<br />~PatternField<br />[[RadioButton]]<br />~TextField<br />~TimeField | All |A control on an open form or within a [[GridControl]] of one of the allowed types |
!!!Syntax
//control//{{{.ControlSource}}}
{{{getControlSource(}}}//control//{{{)}}}
!!!Returned value
{{{String}}}
!!!Remarks
The //~ControlSource// property is read-only.
!!!Error messages
|Argument nr.1 is invalid |
!!!See also
[[RecordSource]]
!!!Example
<<tiddler "ControlSource example">>
Display the bound database field
//{{{
Dim ocControl As Object
Set ocControl = getObject("Forms!myForm!myGridControl!myTextField")
MsgBox getControlSource(ocControl)
//}}}
The //~ControlTipText// property specifies the text that appears in a ~ScreenTip when you hold the mouse pointer over a control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />[[SubForm]]-- | All |A control on an open form or within a [[GridControl]] of one of the listed types |
!!!Syntax
//control//{{{.ControlTipText}}}
{{{getControlTipText(}}}//control//{{{)}}}
{{{setControlTipText(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{String}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~ControlTipText' not applicable in this context |
!!!See also
!!!Example
<<tiddler "ControlTipText example">>
Change the tip text of a control
//{{{
Dim ocControl As Object
Set ocControl = getObject("Forms!myForm!myControl")
setControlTipText(ocControl, "This is a new tip !")
//}}}
The types of control can be recognized thru the use either of the [[SubType]] or the //~ControlType// properties. The ~ControlType property is there for compatibility with ~MSAccess but has the disadvantage to not discriminate control types 100%, e.g. a ~TextField cannot be distinguished from a ~FormattedField control type.
See the correspondence table below.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | All | All |A control on an open form |
!!!Syntax
//control//{{{.ControlType}}}
{{{getControlType(}}}//control//{{{)}}}
!!!Returned values
{{{Integer}}}
Table of values:
<<tiddler "ControlTypesList">>
Instead of using the numeric values for ~ControlType, one may copy next code and paste it in his/her own code. This allows to use symbolic names, more or less compatible with those existing in ~MSAccess. "More or less" as many control types do not match: e.g. a "spin button" is unknown in ~MSAccess.
//{{{
REM Control Types
REM -----------------------------------------------------------------
Global Const acCheckBox = 5
Global Const acComboBox = 7
Global Const acCommandButton = 2: Global Const acToggleButton = 122
Global Const acCurrencyField = 18
Global Const acDateField = 15
Global Const acFileControl = 12
Global Const acFixedText = 10 : Global Const acLabel = 10
Global Const acFormattedField = 9
Global Const acGridControl = 11
Global Const acGroupBox = 8 : Global Const acOptionGroup = 8
Global Const acHiddenControl = 13
Global Const acImageButton = 4
Global Const acImageControl = 14: Global Const acImage = 14
Global Const acListBox = 6
Global Const acNavigationBar = 22
Global Const acNumericField = 17
Global Const acPatternField = 19
Global Const acRadioButton = 3 : Global Const acOptionButton = 3
Global Const acScrollBar = 20
Global Const acSpinButton = 21
Global Const acSubform = 112
Global Const acTextField = 9 : Global Const acTextBox = 9
Global Const acTimeField = 16
//}}}
!!!Remarks
The ~ControlType property is read-only.
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[SubType]]
!!!Example
<<tiddler "ControlType example">>
List name, controltype and subtype of all controls on an open form
//{{{
Dim ofForm As Object, ocControl As Object, i As Integer, iCount As Integer
Set ofForm = Forms("myForm")
iCount = Controls(ofForm).Count
For i = 0 To iCount - 1
Set ocControl = Controls(ofForm, i)
Print ocControl.pName & "/" & ocControl.SubType & "/" & ocControl.ControlType,
Next i
Print
//}}}
| !~SubType | !~ControlType |Allowed in [[GridControls|GridControl]] |
|CHECKBOX | 5 | Y |
|[[COMBOBOX|ComboBox]] | 7 | Y |
|COMMANDBUTTON | 2 ||
|CURRENCYFIELD | 18 | Y |
|DATEFIELD | 15 | Y |
|FILECONTROL | 12 ||
|FIXEDTEXT | 10 ||
|FORMATTEDFIELD | 9 | Y |
|[[GRIDCONTROL|GridControl]] | 11 ||
|GROUPBOX | 8 ||
|HIDDENCONTROL | 13 ||
|IMAGEBUTTON | 4 ||
|IMAGECONTROL | 14 ||
|[[LISTBOX|ListBox]] | 6 | Y |
|NAVIGATIONBAR | 22 ||
|NUMERICFIELD | 17 | Y |
|PATTERNFIELD | 19 | Y |
|[[RADIOBUTTON|RadioButton]] | 3 ||
|SCROLLBAR | 20 ||
|SPINBUTTON | 21 ||
|[[SUBFORMCONTROL|SubForm]] | 112 ||
|TEXTFIELD | 9 | Y |
|TIMEFIELD | 16 | Y |
The //Controls// collection describes instances of all __controls__ present either
*in an open [[form|Form]]
*in a [[subform|SubForm]] of an open form
*in a [[GridControl]] part of an open form or one of its subforms
*or in an [[OptionGroup]] (radio buttons)
!!!Syntax
{{{Controls(form)}}} or {{{Controls(formname)}}}
{{{Controls(form, index)}}} or {{{Controls(formname, index)}}}
{{{Controls(form, controlname)}}} or {{{Controls(formname, controlname)}}}
{{{Controls(subform)}}}
{{{Controls(subform, index)}}} or {{{Controls(subform, controlname)}}}
{{{Controls(gridcontrol)}}}
{{{Controls(gridcontrol, controlname)}}} or {{{Controls(gridcontrol, index)}}}
{{{Controls(optiongroup)}}}
{{{Controls(optiongroup, index)}}}
| !Argument #1 | !Type | !Argument #2 | !Type |!Returned value |
| form | [[Form object|Form]] || absent |A [[Collection]] of the controls of the form |
| formname | String |~|~|~|
| form | [[Form object|Form]] | index | integer<br />long |A [[control object|Control]] |
| formname | String |~|~|~|
| form | [[Form object|Form]] | controlname | string |~|
| formname | string |~|~|~|
| subform | [[Subform object|SubForm]] || absent |A [[Collection]] of the controls of the subform |
|~|~| index | integer<br />long |A [[control object|Control]] |
|~|~| controlname | string |~|
| gridcontrol | [[Gridcontrol object|GridControl]] || absent |A [[Collection]] of the controls of the gridcontrol |
|~|~| index | integer<br />long |A [[control object|Control]] |
|~|~| controlname | string |~|
| optiongroup | [[Optiongroup object|OptionGroup]] || absent |A [[Collection]] of the controls of the optiongroup |
|~|~| index | integer<br />long |A [[control object|Control]] |
!!!Remarks
*~Access2Base does not support a hierarchy of form names although Base does it. Only single form names are allowed.
*Control [[collections|Collection]] are numbered from 0 to {{{Controls(...).Count - 1}}}
*The //formname// and //controlname// arguments are not case sensitive.
!!!Error messages
|Argument nr.X is invalid |
|Out of array range or incorrect array size for collection Controls() |
|Form '...' not found |
|Form '...' is currently not open|
|Control '...' not found in parent (form or grid) '...' |
!!!Examples
<<tiddler "Controls examples">>
To identify the last control of an open form
//{{{
Dim ofForm As Object, iCount As Integer
Set ofForm = Forms("myForm")
iCount = Controls(ofForm).Count ' or getCount(Controls(ofForm))
MsgBox "The form " & ofForm.pName & " has " & iCount & " controls." _
& "The last one is " & Controls(ofForm, iCount - 1).pName
//}}}
To know the controls present in a gridcontrol (datagrid)
//{{{
Dim ocGrid As Object, i As Integer, iCountGrid As Integer
Set ocGrid = Controls("myform", "myGridControl")
iCountGrid = Controls(ocGrid).Count
For i = 0 To iCountGrid - 1
Print getName(Controls(ocGrid, i)),
Next i
Print
//}}}
The //Count// property identifies the number of items present in a [[collection|Collection]].
!!!Applies to ...
| !Collection |!Description |
| [[AllForms]] |All forms, open or closed, in the current database document (".odb" file) |
| [[Controls]] |All controls of an open form |
| [[Forms]] |All open forms |
| [[Properties]] |All properties of a [[pseudo object|Pseudo Object]] |
| !Pseudo object |!Description |
| [[OptionGroup]] |Groups the [[Radio buttons|RadioButton]] with the same name within a form. |
!!!Syntax
//collection//{{{.Count}}}
{{{getCount(}}}//collection//{{{)}}}
//control//{{{.Count}}}
{{{getCount(}}}//control//{{{)}}}
//optiongroup//{{{.Count}}}
{{{getCount(}}}//optiongroup//{{{)}}}
!!!Returned values
{{{Integer}}} >= 0
!!!Remarks
*The //Count// property is read-only.
*The items of the [[collection|Collection]] are always numbered from 0 to {{{Count - 1}}}
!!!Error messages
|Argument nr.1 is invalid |
!!!Example
<<tiddler "Count example">>
The following example uses the Count property to control a loop that prints information about all open forms and their controls.
//{{{
Dim ofForm As Object, i As Integer
Dim j As Integer
Dim iControls As Integer, iForms As Integer
iForms = Forms.Count ' Number of open forms.
If iForms > 0 Then
For i = 0 To iForms - 1
Set ofForm = Forms(i)
Print ofForm.pName;
iControls = Controls(ofForm).Count
If iControls > 0 Then
For j = 0 To iControls - 1
Print Controls(ofForm, j).pName;
Next j
End If
Next i
End If
Print
//}}}
The //~CurrentDb// method returns the current [[database|Database]] object..
!!!Syntax
{{{CurrentDb()}}}
!!!Returned values / Arguments
{{{Database}}} pseudo-object or {{{Null}}}
!!!Remarks
The ~CurrentDb method returns {{{Null}}} if there is currently no database connected. In case of unwanted disconnection The [[OpenConnection]] //sub// may be (re)executed to (re)create a valid connection.
!!!Error messages
None
!!!See also
[[Database]]
[[OpenConnection]]
!!!Example
<<tiddler "CurrentDb example">>
Reconnect database after unwanted disconnection
//{{{
If IsNull(CurrentDb) Then Call OpenConnection(ThisDatabaseDocument)
//}}}
You can use the ~DAvg function to determine the average of a set of values in a specified set of records (a domain).
!!!Syntax
{{{DAvg(expression, domain[, criteria])}}}
!!!Arguments
| !Argument | !Type |!Description |
|Expression | String |An expression that identifies the field whose value you want to return. It can be a string expression identifying a field in a table or query, or it can be a SQL expression that performs a calculation on data in that field. However the SQL expression must not include any SQL aggregate function. |
|Domain | String |A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter. |
|Criteria | String |An optional string expression used to restrict the range of data on which the ~DAvg function is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria is omitted, the ~DAvg function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain. |
!!!Returned value
{{{Variant}}}
!!!Remarks
*All //expression//, //domain// and //criteria// arguments may use database record- or fieldnames surrounded wit square brackets [].
*If no record satisfies //criteria// or if //domain// contains no records, the ~DAvg function returns a ''Null''.
*Construct the //criteria// argument carefully to ensure that it will be evaluated correctly as a valid WHERE clause.
!!!Error messages
|~DFunction execution failed SQL='...' |
!!!See also
[[DCount]]
[[DLookup]]
[[DMin, DMax]]
[[DStDev, DStDevP]]
[[DSum]]
[[DVar, DVarP]]
!!!Example
<<tiddler "Dfunctions example">>
You can use the ~DCount function to determine the number of records that are in a specified set of records (a domain).
!!!Syntax
{{{DCount(expression, domain[, criteria])}}}
!!!Arguments
| !Argument | !Type |!Description |
|Expression | String |An expression that identifies the field whose value you want to return. It can be a string expression identifying a field in a table or query, or it can be a SQL expression that performs a calculation on data in that field. However the SQL expression must not include any SQL aggregate function. |
|Domain | String |A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter. |
|Criteria | String |An optional string expression used to restrict the range of data on which the ~DCount function is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria is omitted, the DCount function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain. |
!!!Returned value
{{{Integer}}} or {{{Long Variant}}}
!!!Remarks
*All //expression//, //domain// and //criteria// arguments may use database record- or fieldnames surrounded wit square brackets [].
*If no record satisfies //criteria// or if //domain// contains no records, the ~DCount function returns a ''Null''.
*Construct the //criteria// argument carefully to ensure that it will be evaluated correctly as a valid WHERE clause.
!!!Error messages
|~DFunction execution failed SQL='...' |
!!!See also
[[DAvg]]
[[DLookup]]
[[DMin, DMax]]
[[DStDev, DStDevP]]
[[DSum]]
[[DVar, DVarP]]
!!!Example
<<tiddler "Dfunctions example">>
You can use the ~DLookup function to get the value of a particular field from a specified set of records (a domain).
You can use the ~DLookup function to display the value of a field that isn't in the record source for your form. For example, suppose you have a form based on an Order Details table. The form displays the ~OrderID, ~ProductID, ~UnitPrice, Quantity, and Discount fields. However, the ~ProductName field is in another table, the Products table. You could use the ~DLookup function in an event to display the ~ProductName on the same form.
!!!Syntax
{{{DLookup(expression, domain[, criteria][, orderclause])}}}
!!!Arguments
| !Argument | !Type |!Description |
|Expression | String |An expression that identifies the field whose value you want to return. It can be a string expression identifying a field in a table or query, or it can be a SQL expression that performs a calculation on data in that field. However the SQL expression must not include any SQL aggregate function. |
|Domain | String |A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter. |
|Criteria | String |An optional string expression used to restrict the range of data on which the ~DLookup function is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria is omitted, the ~DLookup function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain. |
|Orderclause | String |A string expression specifying the sequence of the returned records. It is a SQL ORDER BY clause without the words ORDER BY. It can include the ASC or DESC keywords. |
!!!Returned value
{{{Variant}}}
!!!Remarks
*All //expression//, //domain//, //criteria// and //orderclause// arguments may use database record- or fieldnames surrounded wit square brackets [].
*The ~DLookup function returns a single field value based on the information specified in //criteria//. If more than one record meet //domain// and //criteria//, the DLookup function returns a __random__ value in the domain. If a //orderclause// is present the ~DLookup function will return the __first__ value that meets the criteria.
*If no record satisfies //criteria// or if //domain// contains no records, the ~DLookup function returns a ''Null''.
*Construct the //criteria// argument carefully to ensure that it will be evaluated correctly as a valid WHERE clause.
!!!Error messages
|~DFunction execution failed SQL='...' |
!!!See also
[[DAvg]]
[[DCount]]
[[DMin, DMax]]
[[DStDev, DStDevP]]
[[DSum]]
[[DVar, DVarP]]
!!!Example
<<tiddler "Dfunctions example">>
You can use the ~DMin and ~DMax functions to determine the minimum and maximum values of a set of values in a specified set of records (a domain).
!!!Syntax
{{{DMin(expression, domain[, criteria])}}}
{{{DMax(expression, domain[, criteria])}}}
!!!Arguments
| !Argument | !Type |!Description |
|Expression | String |An expression that identifies the field whose value you want to return. It can be a string expression identifying a field in a table or query, or it can be a SQL expression that performs a calculation on data in that field. However the SQL expression must not include any SQL aggregate function. |
|Domain | String |A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter. |
|Criteria | String |An optional string expression used to restrict the range of data on which the ~DMin (~DMax) function is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria is omitted, the ~DMin (~DMax) function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain. |
!!!Returned value
{{{Variant}}}
!!!Remarks
*All //expression//, //domain// and //criteria// arguments may use database record- or fieldnames surrounded wit square brackets [].
*If no record satisfies //criteria// or if //domain// contains no records, the ~DMin (~DMax) function returns a ''Null''.
*Construct the //criteria// argument carefully to ensure that it will be evaluated correctly as a valid WHERE clause.
!!!Error messages
|~DFunction execution failed SQL='...' |
!!!See also
[[DAvg]]
[[DCount]]
[[DLookup]]
[[DStDev, DStDevP]]
[[DSum]]
[[DVar, DVarP]]
!!!Example
<<tiddler "Dfunctions example">>
You can use the ~DStDev and ~DStDevP functions to determine the standard deviation of a set of values in a specified set of records (a domain).
!!!Syntax
{{{DStDev(expression, domain[, criteria])}}}
{{{DStDevP(expression, domain[, criteria])}}}
!!!Arguments
| !Argument | !Type |!Description |
|Expression | String |An expression that identifies the field whose value you want to return. It can be a string expression identifying a field in a table or query, or it can be a SQL expression that performs a calculation on data in that field. However the SQL expression must not include any SQL aggregate function. |
|Domain | String |A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter. |
|Criteria | String |An optional string expression used to restrict the range of data on which the ~DStDev (~DStDevP) function is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria is omitted, the ~DStDev (~DStDevP) function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain. |
!!!Returned value
{{{Variant}}}
!!!Remarks
*All //expression//, //domain// and //criteria// arguments may use database record- or fieldnames surrounded wit square brackets [].
*If no record satisfies //criteria// or if //domain// contains no records, the ~DStDev (~DStDevP) function returns a ''Null''.
*Construct the //criteria// argument carefully to ensure that it will be evaluated correctly as a valid WHERE clause.
!!!Error messages
|~DFunction execution failed SQL='...' |
!!!See also
[[DAvg]]
[[DCount]]
[[DLookup]]
[[DMin, DMax]]
[[DSum]]
[[DVar, DVarP]]
!!!Example
<<tiddler "Dfunctions example">>
You can use the ~DSum function to determine the sum of a set of numeric values in a specified set of records (a domain).
!!!Syntax
{{{DSum(expression, domain[, criteria])}}}
!!!Arguments
| !Argument | !Type |!Description |
|Expression | String |An expression that identifies the field whose value you want to return. It can be a string expression identifying a field in a table or query, or it can be a SQL expression that performs a calculation on data in that field. However the SQL expression must not include any SQL aggregate function. |
|Domain | String |A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter. |
|Criteria | String |An optional string expression used to restrict the range of data on which the ~DSum function is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria is omitted, the ~DSum function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain. |
!!!Returned value
{{{Variant}}}
!!!Remarks
*All //expression//, //domain// and //criteria// arguments may use database record- or fieldnames surrounded wit square brackets [].
*If no record satisfies //criteria// or if //domain// contains no records, the ~DSum function returns a ''Null''.
*Construct the //criteria// argument carefully to ensure that it will be evaluated correctly as a valid WHERE clause.
!!!Error messages
|~DFunction execution failed SQL='...' |
!!!See also
[[DAvg]]
[[DCount]]
[[DLookup]]
[[DMin, DMax]]
[[DStDev, DStDevP]]
[[DVar, DVarP]]
!!!Example
<<tiddler "Dfunctions example">>
You can use the ~DVar and ~DVarP functions to determine the variance of a set of values in a specified set of records (a domain).
!!!Syntax
{{{DVar(expression, domain[, criteria])}}}
{{{DVarP(expression, domain[, criteria])}}}
!!!Arguments
| !Argument | !Type |!Description |
|Expression | String |An expression that identifies the field whose value you want to return. It can be a string expression identifying a field in a table or query, or it can be a SQL expression that performs a calculation on data in that field. However the SQL expression must not include any SQL aggregate function. |
|Domain | String |A string expression identifying the set of records that constitutes the domain. It can be a table name or a query name for a query that does not require a parameter. |
|Criteria | String |An optional string expression used to restrict the range of data on which the ~DVar (~DVarP) function is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria is omitted, the ~DVar (~DVarP) function evaluates expr against the entire domain. Any field that is included in criteria must also be a field in domain. |
!!!Returned value
{{{Variant}}}
!!!Remarks
*All //expression//, //domain// and //criteria// arguments may use database record- or fieldnames surrounded wit square brackets [].
*If no record satisfies //criteria// or if //domain// contains no records, the ~DVar (~DVarP) function returns a ''Null''.
*Construct the //criteria// argument carefully to ensure that it will be evaluated correctly as a valid WHERE clause.
!!!Error messages
|~DFunction execution failed SQL='...' |
!!!See also
[[DAvg]]
[[DCount]]
[[DLookup]]
[[DMin, DMax]]
[[DStDev, DStDevP]]
[[DSum]]
!!!Example
<<tiddler "Dfunctions example">>
{{firstletter{
@@color:#930;A@@
}}} //Database// [[Pseudo-Object|Pseudo Object]] describes the database the application is currently connected to.
!!!Functions returning a database pseudo-object
| !Function | !Type | !Argument |!Description |
|[[CurrentDb]] | Method | none |{{{CurrentDb()}}} returns a pseudo-object corresponding with the current database. |
!!!Properties
| !Property | !Type | !Read only | !Description or UNO object |
|Document | UNO | Y |com.sun.star.comp.dba.~ODatabaseDocument |
|Connection | UNO | Y |com.sun.star.sdbc.drivers.~OConnectionWrapper |
|~MetaData | UNO | Y |interface ~XDatabaseMetaData |
!!!Methods
None
!!!See also
[[CurrentDb]]
!!!Remarks
The Database pseudo-object has no real usage in the frame of ~Access2Base. Except if the developer wants to access its UNO properties.
You can use the Default property to specify whether a command button is the default button on a form.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |~CommandButton | None |A control on an open form |
!!!Syntax
//control//{{{.Default}}}
{{{getDefault(}}}//control//{{{)}}}
{{{setDefault(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property 'Default' not applicable in this context |
!!!See also
[[Cancel]]
!!!Example
<<tiddler "Cancel & Default example">>
The //~DefaultValue// property specifies a value that is automatically entered in a field when a new record is created.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |~CheckBox<br />[[ComboBox]]<br />~CommandButton<br />~CurrencyField<br />~DateField<br />~FileControl<br />~FormattedField<br />[[ListBox]]<br />~NumericField<br />~PatternField<br />[[RadioButton]]<br />~SpinButton<br />~TextField<br />~TimeField | All |A control on an open form |
!!!Syntax
//control//{{{.DefaultValue}}}
{{{getDefaultValue(}}}//control//{{{)}}}
{{{setDefaultValue(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Variant}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~DefaultValue' not applicable in this context |
|Value '...' is invalid for property '~DefaultValue' |
!!!Example
<<tiddler "DefaultValue example">>
List the default value of all controls - if relevant - on an open form
//{{{
Dim ofForm As Object, ocControl As Object, i As Integer, iCount As Integer
Set ofForm = Forms("myForm")
iCount = Controls(ofForm).Count
For i = 0 To iCount - 1
Set ocControl = Controls(ofForm, i)
If hasProperty(ocControl, "DefaultValue") Then Print ocControl.pName & "=" & ocControl.DefaultValue,
Next i
Print
//}}}
Database functions
//{{{
Dim sLabel As String, sKey As String, sCategory As String
Dim dblAverage As Double, iCount As Integer, dblSum As Double
Dim dblMin As Double, dblMax As Double
Dim dblStdev As Double, dblStdevP As Double, dblVar As Double, dblVarP As Double
sKey = "27165"
sLabel = DLookup("[DESCRIPTION]", "[PRODUCTS]", "[PRODUCT CODE]='" & sKey & "'") ' SQL expects single quotes
sCategory = "METALLIC"
dblAverage = DAvg("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
iCount = DCount("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
dblSum = DSum("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
' dblAverage should be = dblSum/iCount !!!
dblMin = DMin("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
dblMax= DMax("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
dblStdev = DStdev("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
dblStdevP = DStdevP("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
dblVar = DVar("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
dblVarP = DVarP("[SALES PRICE]", "[PRODUCTS]", "[CATEGORY]='" & sCategory & "' AND [SALES PRICE]>0")
' Sqr(dblVar) should be = dblStdev !!!
//}}}
!!Download //~Access2Base// from the
*[[OpenOffice extensions repository|http://extensions.services.openoffice.org/en/project/access2base]]
*[[LibreOffice extensions center|http://extensions.libreoffice.org/extension-center/access2base]]
!!Install the //~Access2Base// extension
The name of he downloaded file is __~Access2Base.oxt__.
Install the extension as any other extension. To know more, follow the instructions in "[[Installing an extension|http://extensions.services.openoffice.org/en/resources/user/howto_install]]" or download next [[PDF file|http://www.libreoffice.org/assets/Uploads/EN_Documents/Installingextensions.pdf]]
!!Use the extension
To be able to invoke the //~Access2Base// API from a ~OOo/~LibO ".odb" file (the usual suffix for the front-end part of database documents) you have to
*Have a minimal knowledge of the Basic IDE.
*Open the ".odb" file (the database document) in the main ~OOo/~LibO Base window.
*With {{{Tools + Macros + Organize Macros + OpenOffice[LibreOffice] Basic...}}} open the Basic IDE and create a Basic module in the Standard library of the database document. The module should contain as a minimum next code:
<<tiddler "Openconnection example">>
*Assign in the main Base window with menu items {{{Tools + Customize...}}} ({{{Events}}} tab) the above Sub ("~DBOpen" in the example but use the name of your choice) to the //~OpenDocument// event. Save in the ".odb" file itself.
*//Close// and re-//open// the ".odb" file. This will trigger the //~OpenDocument// event.
*Start programming macro's. Associate them with //form// or //control events// if relevant.
!!The Basic IDE ...
... has now 2 more options:
#The {{{Tools + Add-Ons + Access2Base Console ...}}} menu item opens the ~Access2Base console (see the [[Error Handler]]).
#The {{{Help + Access2Base Online Help}}} menu item opens the current Help file in your preferred browser.
!!See also
[[OpenConnection]]
!!Software exposure
Before releasing a new version of the ~Access2Base API a battery of non-regression tests is run automatically on next environments:
| !Software | !Version | !Operating System |
|~LibreOffice | 3.4 |Linux Ubuntu 11.10 |
|~OpenOffice | 3.3 |Windows XP |
|~OpenOffice | 3.2 |Windows XP |
|~OpenOffice | 3.2 |Windows Vista |
|~LibreOffice<br />(Portable version) | 3.4 |Windows XP |
!!Releases History
| !Version | !Description |
| 0.5.0 |First public release |
The //Enabled// property specifies if the control is accessible with the cursor.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />[[SubForm]]-- | All |A control on an open form |
!!!Syntax
//control//{{{.Enabled}}}
{{{getEnabled(}}}//control//{{{)}}}
{{{setEnabled(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property 'Enabled' not applicable in this context |
!!!See also
[[Locked]]
!!!Example
<<tiddler "Enabled & Locked example">>
Lock and disable control
//{{{
Dim ocControl As Object
Set ocControl = Controls("myForm", "myControl")
setEnabled(ocControl, False)
setLocked(ocControl, True)
//}}}
!!!Introduction
~Access2Base uses internally an error handler that can be optionally used by users in their own code.
The principles are:
*An error has an __error-level__. The error-level determines the severity of the error and the behaviour of the program after the error trap: stop or go ahead ?
*All errors, whatever their level, can be registered on the request of the programmer. The technique used by ~Access2Base is to keep the error //traces// in memory through a //circular buffer//, i.e. a buffer where the oldest entries are replaced by the new ones when the buffer gets full.
*The error traces (circular buffer) can be viewed for debugging purposes.
*All the user-defined Subs or Functions follow the same code structure for error handling.
!!!To view the errors log
Use the
>{{{Tools + Add-Ons + Access2Base Trace ...}}}
menu action in the Basic IDE.
!!!API
The routines for error handling are:
|TraceConsole |Open a dialog box for display of all past errors and logs. |
|TraceError |Report an error found. |
|TraceLog |Log an event in the circular buffer if its level is at least equal to the minimal error level. |
!!!Error levels
| !Level | !Description |
|DEBUG |To report values of variables during the program execution. The report is NOT user visible. |
|INFO |To report any event |
|WARNING |To report some abnormal event. |
|ERROR |To report an error trapped by a user program. |
|FATAL |To report an error detected by ~Access2Base (f.i. "Form does not exist ..." etc.). |
|ABORT |To report an error inside the ~Access2Base API itself. Do not use for programmer or user errors. |
!!!Recommended program structure for error handling
The example is given for a //Sub//. It is, mutatis mutandis, equally valid for a //Function//.
//{{{
Sub mySub
On Local Error Goto Error_Sub
...
Exit_Sub:
Exit Sub
Error_Sub:
TraceError("ERROR", Err, "MySub", Erl)
Goto Exit_Sub
End Sub
//}}}
In case of error next message will be displayed to the user and simultaneously registered in the trace buffer:
>Error # //number// (//...description...//) occurred at line //line// in mySub.
The {{{Event}}} [[pseudo-object|Pseudo Object]] describes an event occurred in a form or a form control.
!!!Functions returning an //Event// pseudo-object
| !Function | !Type | !Arguments |!Description |
|[[Events]] | [[Collection]] | the //event// object passed by ~OpenOffice/~LibreOffice<br />as argument of a form or control event |{{{Events(oEvent)}}} returns an //Event// pseudo-object. |
!!!Properties of an //Event// pseudo-object
| !Property | !Type | !Description |
|~EventType | String |See the [[events handler|Events Handler]]. |
|~EventName | String ||
|~ContextShortcut | String |The [[shortcut notation|ShortCut Notation]] of the object (form or control) having triggered the event. |
|~ButtonLeft<br />~ButtonRight<br />~ButtonMiddle | Boolean |Indicates if the mouse button has been pressed .|
|~XPos<br />~YPos | Null or Long |Coordinates of the mouse cursor. |
|~ClickCount | Long |Number of mouse clicks. |
|~KeyCode | Integer |See the constants group com.sun.star.awt.Key |
|~KeyChar | String |The pressed key. |
|~KeyFunction | Integer |See the constants group com.sun.star.awt.~KeyFunction |
|~KeyAlt<br />~KeyCtrl<br />~KeyShift | Boolean |Key combined with Alt, Ctrl or Shift keys. |
|~FocusChangeTemporary | Boolean |False if focus change due to a user action in same window. |
|~RowChangeAction | Long |See the constants group com.sun.star.sdb.~RowChangeAction |
!!!Remarks
*All properties are read-only.
*Their values are accessible with the usual syntaxes:<br />//{{{get[property](}}}oEvent{{{)}}}// and <br />//oEvent.{{{[property]}}}//
!!!See also
[[Events Handler]]
[[Events]]
!!!Example
<<tiddler "Event example">>
Assign next macro to the //~TextModified// event of a combo box (other controls could require that the //Changed// event should be used for the same purpose).
When the user changes his/her selection in the combo box the content of the form is requeried and refreshed on the screen.
//{{{
Sub SelectChanged(poEvent As Object)
REM Combo value has changed
REM => requery form
Dim oeEvent As Object, ocCombo As Object, sSQL As String, oForm As Object
Set oeEvent = Events(poEvent)
Set ocCombo = getObject(oeEvent.ContextShortcut)
sSQL = "SELECT [PRODUCT CODE],[DENOMINATION],[SUPPLIER ID] FROM PRODUCTS WHERE " _
& "[SUPPLIER ID]='" & ocCombo.Value & "'"
Set oForm = Forms("myComboForm")
setRecordSource(oForm, sSQL)
End Sub
//}}}
The {{{Events}}} collection returns the (unique) instance of the currently executed [[event pseudo-object|Event]].
!!!Syntax
{{{Events(}}}//event//{{{)}}}
The //event// argument is the variable of {{{Object}}} type given as argument by ~OpenOffice/~LibreOffice to the macro invoked when the event occurs.
!!!Returned values
Either
- a {{{Null}}} value - the event is not really an event or it was triggered by an unsupported event type - or some other error occurred (the call to {{{Events()}}} never stops the execution of the macro).
or
- a pseudo-object of type //Event//.
!!!See also
[[Events Handler]]
[[Event]]
!!!Example
<<tiddler "Event example">>
{{firstletter{
@@color:#930;E@@
}}}''vents'' can automatically execute a macro when a specified software event occurs by assigning the desired macro to the event. The macros might be defined at database document, [[form|Form]] or [[control|Control]] level. The triggered macro has one argument of type //Object//.
The //Events Handler// of //~Access2Base// provides a mean to standardize the processing of events and to increase the reusability of macros: indeed the same macro could be used for several controls - if meaningful, of course - if, as an example, there is an easy way to identify the control which triggered the macro.
''Note that the described technique has nothing in common with the events processing in //~MSAccess//.''
!!!Step by step
#Assign the event to a macro: see the ~OpenOffice/~LibreOffice Help or documentation.
#In the code of the macro invoke the [[Events]] collection. Note that the macro may be a {{{Sub}}} or a {{{Function}}} depending on the necessity or not to return the value {{{False}}} to cancel the event.
#Use the properties of the returned object to process the event. In particular the //~ContextShortcut// property.
//{{{
Sub myEventMacro(poEvent As Object)
Dim oeEvent As Object, myControl As Object
Set oeEvent = Events(poEvent)
Set myControl = getObject(oEvent.ContextShortcut) ' Return the Control pseudo-object
' that triggered the event
REM ...
End Sub
//}}}
!!!Event types
The types of events supported by the ~Access2Base API are listed below. See the ~OpenOffice/~LibreOffice documentation for more details.
Other event types are ignored and the invocation of {{{Events()}}} returns a {{{Null}}} value.
| !Event type | !Description |
|DOCUMENTEVENT |At document (database) level. |
|EVENTOBJECT |Generic for most //form// and //control// events. |
|ACTIONEVENT |Triggered by a button, ... |
|FOCUSEVENT |Triggered by a focus change. |
|INPUTEVENT |Use of special keys. |
|ITEMEVENT |Action in menu or listbox. |
|KEYEVENT |Use of normal keys. |
|MOUSEEVENT |Mouse move of click. |
|ROWCHANGEEVENT |Insert, update or delete action. |
|TEXTEVENT |Edition of //control// content. |
!!!See also
[[Events]]
[[Event]]
[[getObject]]
!!!Example
<<tiddler "Event example">>
You can use the //Filter// property to specify a subset of records to be displayed when a filter is applied to a form.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
|[[SubForm]] |A subform in an open form |
!!!Syntax
//form//{{{.Filter}}}
{{{getFilter(}}}//form//{{{)}}}
{{{setFilter(}}}//form//{{{,}}}//value//{{{)}}}
//subform//{{{.Filter}}}
{{{getFilter(}}}//subform//{{{)}}}
{{{setFilter(}}}//subform//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{String}}}
!!!Remarks
The //Filter// property is a string expression consisting of a ''WHERE'' clause without the WHERE keyword. Like in //~MsAccess// __table names__, or __field names__ (e.g. when containing a space) may be surrounded by square brackets ([]).
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[FilterOn]]
!!!Example
<<tiddler "Filter example">>
Set and apply a filter on a form
//{{{
Dim ofForm As Object, sFilter As String
Set ofForm = Forms("myForm")
sFilter = "[VAT CODE]=3 And [PRODUCT CODE]<'28000'"
setFilter(ofForm, sFilter)
setFilterOn(ofForm, True)
//}}}
Use the //~FilterOn// property to specify or determine whether the Filter property for a form is applied.
!!!Applies to ...
| !Pseudo object | !Type |!Description |
|[[Form]] ||An open form |
|[[SubForm]] ||A subform in an open form |
!!!Syntax
//form//{{{.FilterOn}}}
{{{getFilterOn(}}}//form//{{{)}}}
{{{setFilterOn(}}}//form//{{{,}}}//value//{{{)}}}
//subform//{{{.FilterOn}}}
{{{getFilterOn(}}}//subform//{{{)}}}
{{{setFilterOn(}}}//subform//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[Filter]]
!!!Example
<<tiddler "Filter example">>
{{firstletter{
@@color:#930;T@@
}}}he //~FindNext// [[action|Actions]] finds the next instance of data that meets the criteria specified by the arguments of the last invoked [[FindRecord]] action.
If a match has been found, the cursor is set in the matching field. Otherwise it returns to the starting record.
The starting record is NOT the record wherethe focus is on but the last record reached by the previous //~FindRecord// action.
!!!Syntax
{{{FindNext()}}}
!!!Remarks
*A previous //~FindRecord// action is mandatory. Otherwise the invocation of //~FindNext// will generate an error.
*//~FindNext// returns //True// if a matching occurrence has been found.
!!!Error messages
|~FindNext() must be preceded by a successful ~FindRecord(...) call |
!!!See also
[[FindRecord]]
{{firstletter{
@@color:#930;T@@
}}}he //~FindRecord// [[action|Actions]] finds the first instance of data that meets the criteria specified by the //~FindRecord// arguments. This can be in a succeeding or prior record, or in the first record. The search is done in a single column or in all columns of a __form__ (or __subform__)'s [[GridControl]].
If a match has been found, the cursor is set in the matching field.
!!!Syntax
{{{FindRecord(FindWhat,}}}//{{{ Match, MatchCase, Search, SearchAsFormatted, OnlyCurrentField, FindFirst}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{FindWhat}}} | No | String<br />Date<br />Number |Specifies the data you want to find in the record. Enter the text, number, or date you want to find. |
|{{{Match}}} | Yes | acAnyWhere<br />acEntire<br />acStart |Specifies where the data is located in the field. You can specify a search for data in any part of the field (acAnyWhere), for data that fills the entire field (acEntire), or for data located at the beginning of the field (acStart). The default is acEntire. |
|{{{MatchCase}}} |~| Boolean |Specifies whether the search is case-sensitive (uppercase and lowercase letters must match exactly). The default is False. |
|{{{Search}}} |~| acDown<br />acSearchAll<br />acUp |Specifies whether the search proceeds from the current record up to the beginning of the records (acUp); down to the end of the records (acDown); or down to the end of the records and then from the beginning of the records to the current record, so all records are searched (acSearchAll). The default is acSearchAll. |
|{{{SearchAsFormatted}}} |~| Boolean |If present, must be FALSE. True is not supported. |
|{{{OnlyCurrentField}}} |~| acAll<br />acCurrent |Specifies whether the search is confined to the current field in each record (acCurrent) or includes all fields in each record (acAll). The default is acCurrent. |
|~|~| String |The argument must contain a [[shortcut|ShortCut Notation]] to a GridControl or to a column of a [[GridControl]]. If the shortcut points to a ~GridControl all the columns are scanned to find a match. |
|{{{FindFirst}}} |~| Boolean |Specifies whether the search starts at the first or last record (depending on the //Search// argument) or at the current record. The default is True. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acAnywhere = 0
Global Const acEntire = 1
Global Const acStart = 2
Global Const acDown = 1
Global Const acSearchAll = 2
Global Const acUp = 0
Global Const acAll = 0
Global Const acCurrent = -1
//}}}
!!!Remarks
*The //~FindRecord// action is most often started from an event. Clicking on a button in a form triggering the event might change the focus from the current field to the button which is not the desired effect. In that case use the [[setFocus]] method, either on the //form// or on the targetted //control//, above the //~FindRecord// statement.
*The targetted //form// or //subform// MUST contain a //gridcontrol//.
*The //~FindRecord// action is a function. It returns //True// if a match ha been found, and //False// otherwise.
*Using a shortcut as {{{OnlyCurrentField}}} argument is the __only__ way to run a //~FindRecord// action in a //~GridControl// belonging to a //~SubForm//.
!!!Error messages
|No active form or control found |
|Form '...' has no underlying dataset |
|Control '...' not found in gridcontrol '...' |
|No gridcontrol found in form '...' |
!!!See also
[[FindNext]]
[[setFocus]]
!!!Example
<<tiddler "FindRecord example">>
Find the record starting from the top having the value "3" in one of the numeric columns:
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
setFocus(ofForm)
If Not FindRecord(3, , , , , acAll) Then MsgBox "Not Found !"
//}}}
Next statement will retrieve the next occurrence:
//{{{
FindNext() ' Parentheses are optional
//}}}
Change control aspect
//{{{
Dim ofForm As Object, ocControl As Object
Set ofForm = Forms("myForm")
Set ocControl = Controls(ofForm, "myControl")
If getValue(Controls(ofForm, "myChkBox")) = 1 Then
setFontName(ocControl, "Verdana")
setFontSize(ocControl, 18)
setFontBold(ocControl, True)
setFontItalic(ocControl, True)
setFontUnderline(ocControl, True)
setForeColor(ocControl, RGB(255, 0, 0)
setTextAlign(ocControl, 2)
End If
//}}}
... or alternatively ...
//{{{
Dim ofForm As Object, ocControl As Object
Set ofForm = Forms("myForm")
Set ocControl = Controls(ofForm, "myControl")
If getValue(Controls(ofForm, "myChkBox")) = 1 Then
setFontName(ocControl, "Verdana")
setFontSize(ocControl, 18)
setFontWeight(ocControl, com.sun.star.awt.FontWeight.ULTRABOLD) ' <<<<<<<<<
setFontItalic(ocControl, True)
setFontUnderline(ocControl, True)
setForeColor(ocControl, RGB(255, 0, 0)
setTextAlign(ocControl, 2)
End If
//}}}
The //~FontBold// property specifies whether a font appears in a bold style in a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />~ImageButton<br />~ImageControl<br />~ScrollBar<br />~SpinButton<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.FontBold}}}
{{{getFontBold(}}}//control//{{{)}}}
{{{setFontBold(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~FontBold' not applicable in this context |
!!!See also
[[FontItalic]]
[[FontName]]
[[FontSize]]
[[FontUnderline]]
[[FontWeight]]
[[ForeColor]]
[[TextAlign]]
!!!Example
<<tiddler "Font example">>
The //~FontItalic// property specifies whether text appears in italic in a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />~ImageButton<br />~ImageControl<br />~ScrollBar<br />~SpinButton<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.FontItalic}}}
{{{getFontItalic(}}}//control//{{{)}}}
{{{setFontItalic(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~FontItalic' not applicable in this context |
!!!See also
[[FontBold]]
[[FontName]]
[[FontSize]]
[[FontUnderline]]
[[FontWeight]]
[[ForeColor]]
[[TextAlign]]
!!!Example
<<tiddler "Font example">>
The //~FontName// property specifies the name of the font used to display a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />~ImageButton<br />~ImageControl<br />~ScrollBar<br />~SpinButton<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.FontName}}}
{{{getFontName(}}}//control//{{{)}}}
{{{setFontName(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{String}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~FontName' not applicable in this context |
!!!See also
[[FontBold]]
[[FontItalic]]
[[FontSize]]
[[FontUnderline]]
[[FontWeight]]
[[ForeColor]]
[[TextAlign]]
!!!Example
<<tiddler "Font example">>
The //~FontSize// property specifies the size of the font used to display a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />~ImageButton<br />~ImageControl<br />~ScrollBar<br />~SpinButton<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.FontSize}}}
{{{getFontSize(}}}//control//{{{)}}}
{{{setFontSize(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Integer}}} or {{{Long}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~FontSize' not applicable in this context |
!!!See also
[[FontBold]]
[[FontItalic]]
[[FontName]]
[[FontUnderline]]
[[FontWeight]]
[[ForeColor]]
[[TextAlign]]
!!!Example
<<tiddler "Font example">>
The //~FontUnderline// property specifies whether text is underlined in a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />~ImageButton<br />~ImageControl<br />~ScrollBar<br />~SpinButton<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.FontUnderline}}}
{{{getFontUnderline(}}}//control//{{{)}}}
{{{setFontUnderline(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~FontUnderline' not applicable in this context |
!!!See also
[[FontBold]]
[[FontItalic]]
[[FontName]]
[[FontSize]]
[[FontWeight]]
[[ForeColor]]
[[TextAlign]]
!!!Example
<<tiddler "Font example">>
The //~FontWeight// property specifies the line width used to display characters in a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />~ImageButton<br />~ImageControl<br />~ScrollBar<br />~SpinButton<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.FontWeight}}}
{{{getFontWeight(}}}//control//{{{)}}}
{{{setFontWeight(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Integer}}} or {{{Long}}}
!!!Remarks
Allowed values for ~FontWeight are:
| Symbolic name || Numeric value |
|com.sun.star.awt.~FontWeight.DONTKNOW |The font weight is not specified/known. | 0 |
|com.sun.star.awt.~FontWeight.THIN |specifies a 50% font weight. | 50 |
|com.sun.star.awt.~FontWeight.ULTRALIGHT |specifies a 60% font weight. | 60 |
|com.sun.star.awt.~FontWeight.LIGHT |specifies a 75% font weight. | 75 |
|com.sun.star.awt.~FontWeight.SEMILIGHT |specifies a 90% font weight. | 90 |
|com.sun.star.awt.~FontWeight.NORMAL |specifies a normal font weight. | 100 |
|com.sun.star.awt.~FontWeight.SEMIBOLD |specifies a 110% font weight. | 110 |
|com.sun.star.awt.~FontWeight.BOLD |specifies a 150% font weight. | 150 |
|com.sun.star.awt.~FontWeight.ULTRABOLD |specifies a 175% font weight. | 175 |
|com.sun.star.awt.~FontWeight.BLACK |specifies a 200% font weight.| 200 |
!!!Error messages
|Argument nr.X is invalid |
|Property '~FontWeight' not applicable in this context |
!!!See also
[[FontBold]]
[[FontItalic]]
[[FontName]]
[[FontSize]]
[[FontUnderline]]
[[ForeColor]]
[[TextAlign]]
!!!Example
<<tiddler "Font example">>
The //~ForeColor// property specifies or determines the color (RGB) of the text in a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~HiddenControl<br />~ImageButton<br />~ImageControl<br />~ScrollBar<br />~SpinButton<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.ForeColor}}}
{{{getForeColor(}}}//control//{{{)}}}
{{{setForeColor(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Long}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~ForeColor' not applicable in this context |
!!!See also
[[BackColor]]
[[BorderColor]]
[[BorderStyle]]
[[FontBold]]
[[FontItalic]]
[[FontName]]
[[FontSize]]
[[FontUnderline]]
[[FontWeight]]
[[TextAlign]]
!!!Example
<<tiddler "Color example">>
{{firstletter{
@@color:#930;A@@
}}} //Form// [[Pseudo-Object|Pseudo Object]] describes one of the Forms located in the database document (".odb" file). The form can be either opened or closed.
If the property [[IsLoaded]] returns //True// then the form is opened.
!!!Functions returning a form pseudo-object
| !Function | !Type | !Argument |!Description |
|[[AllForms]] | [[Collection]] | Integer or String |{{{AllForms("myForm")}}} returns a pseudo-object corresponding with the {{{myForm}}} form |
|[[Forms]] | [[Collection]] | Integer or String |{{{Forms("myForm")}}} returns a pseudo-object corresponding with the {{{myForm}}} form. {{{myForm}}} must be open. |
|[[getObject]] || String |{{{getObject("Forms!myForm")}}} returns a pseudo-object corresponding with the {{{myForm}}} form. {{{myForm}}} must be open. |
!!!Properties
| !Property | !Type | !Read only | !Description or UNO object |
|[[Name]] || Y |Specifies the real name of the form |
|[[AllowAdditions]] |||Specifies whether a user can add a record when using the form. |
|[[AllowDeletions]] |||Specifies whether a user can delete a record when using the form. |
|[[AllowEdits]] |||Specifies whether a user can modify a record when using the form. |
|[[Caption]] |||Specifies the text that appears in the title bar. |
|[[Filter]] |||Specifies a subset of records to be displayed. |
|[[FilterOn]] |||Specifies if the Filter has to be applied. |
|[[Height]] |||Specifies the height of the form. |
|[[IsLoaded]] || Y |True if form is open. |
|[[OpenArgs]] || Y |Specifies the ~OpenArgs argument of an [[OpenForm]] action. |
|[[RecordSource]] |||Specifies the source of the data. |
|[[Visible]] |||Shows or hides the form. |
|[[Width]] |||Specifies the width of the form. |
|Component | UNO | Y |com.sun.star.text.~TextDocument |
|~ContainerWindow | UNO | Y ||
|~DatabaseForm | UNO | Y |com.sun.star.form.component.~DataForm<br />com.sun.star.sdb.~ResultSet |
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the Form has the given property. |
|[[Move]] | coordinates | Boolean |Return True if Form has been moved successfully. |
|[[setFocus]] | none | Boolean |Return True if focus set on Form successfully. |
!!!Remarks
Each //Form// [[Pseudo-Object|Pseudo Object]] has a Controls [[collection|Collection]], which contains all controls on the form. You can refer to a specific control on a form by referring to the [[Controls]] collection.
!!!Examples
<<tiddler "Forms examples">>
The //Form// property refers to te //Form// associated with a [[subform control|SubForm]].
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | ~SubForm | None |A control on an open form representing a subset (subform) of the form |
!!!Syntax
//control//{{{.Form}}}
{{{getForm(}}}//control//{{{)}}}
!!!Returned values
A [[pseudo object|Pseudo Object]] of type {{{SubForm}}}
!!!Remarks
The //Form// property is read-only.
!!!Error messages
|Argument nr.X is invalid |
!!!See also
The [[SubForm]] pseudo-object
!!!Example
<<tiddler "Subform example">>
The //Format// property determines the way data is displayed in date or time fields.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | ~DateField<br />~FormattedField<br />~TimeField | ~DateField<br />~FormattedField<br />~TimeField |A control on an open form or within a [[GridControl]] of one of the listed types |
!!!Syntax
//control//{{{.Format}}}
{{{getFormat(}}}//control//{{{)}}}
!!!Returned values
{{{String}}}
!!!Remarks
The //Format// property is read-only.
!!!Error messages
|Argument nr.X is invalid |
!!!Examples
<<tiddler "Format example">>
Display the format of a formatted field
//{{{
Dim ocControl As Object
Set ocControl = Controls("myForm", "myFormattedField")
MsgBox getFormat(ocControl)
//}}}
The //Forms// [[collection|Collection]] describes instances of all __open forms__ present in the database document (".odb" file).
!!!Syntax
{{{Forms()}}} or {{{Forms}}}
{{{Forms(index)}}}
{{{Forms(formname)}}}
{{{Forms(event)}}}
| !Argument #1 | !Type |!Returned value |
|| absent |A [[Collection]] object |
| index | integer<br>long |A [[Form]] object corresponding to the index-th item in the Forms() collection. The 1st form is Forms(0), the 2nd is Forms(1) and so on ... The last one is Forms.Count - 1.|
| formname | string |A [[Form]] object having the argument as name. The argument is NOT case-sensitive.|
!!!Remarks
*~Access2Base does not support a hierarchy of form names although Base does it. Only single form names are allowed.
*You can refer to an individual Form object in the Forms collection either by referring to the form by name, or by referring to its index within the collection. If you want to refer to a specific form in the Forms collection, it's better to refer to the form by name because a form's collection index may change. The Forms collection is indexed beginning with zero. If you refer to a form by its index, the first form opened is Forms(0), the second form opened is Forms(1), and so on. If you opened Form1 and then opened Form2, Form2 would be referenced in the Forms collection by its index as Forms(1). If you then closed Form1, Form2 would be referenced in the Forms collection by its index as Forms(0).
*The //formname// argument is not case sensitive.
!!!Error messages
|Argument nr.1 is invalid |
|Out of array range or incorrect array size for collection Forms() |
|Form '...' not found |
|Form '...' is currently not open|
!!!Examples
<<tiddler "Forms examples">>
To display the name of all open forms (uses the [[Name]] property):
//{{{
Dim i As Integer, oCollection As Object
Set oCollection = Forms
For i = 0 To oCollection.Count - 1 'Forms without argument returns a Collection object
Print Forms(i).pName, 'Forms(...) with an argument returns a Form object
Next i
Print
//}}}
Can shorter ... :
//{{{
Dim i As Integer
For i = 0 To Forms.Count - 1 'Forms without argument returns a Collection object
Print Forms(i).pName, 'Forms(...) with an argument returns a Form object
Next i
Print
//}}}
To know the size of an open form:
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
MsgBox "Height = " & ofForm.Height & ", Width = " & ofForm.Width
//}}}
{{firstletter{
@@color:#930;T@@
}}}he //~GoToRecord// [[action|Actions]] makes the specified record the current record in an open form.
!!!Syntax
{{{GoToRecord(}}}//{{{ObjectType, ObjectName, Record, Offset}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{ObjectType}}} | Yes | acActiveDataObject<br />acDataForm |The type of object that contains the record you want to make current. Leave this argument blank to select the active form. |
|{{{ObjectName}}} |~| String |The name of the object that contains the record you want to make the current record. If you leave the Object Type argument blank, leave this argument blank also.<br />This argument may also contain a [[shortcut|ShortCut Notation]] to a [[Form]] or a [[SubForm]]. |
|{{{Record}}} |~| acFirst<br />acGoTo<br />acLast<br />acNewRec<br />acNext<br/>acPrevious |Specifies the record to make the current record The default is //acNext//. |
|{{{Offset}}} |~| Integer<br />Long |This argument specifies the record to make the current record. You can use the Offset argument in two ways:<br />- When the Record argument is //acNext// or //acPrevious//, the cursor moves the number of records forward or backward specified in the Offset argument.<br />- When the Record argument is //acGoTo//, the cursor moves to the record with the number equal to the Offset argument. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acActiveDataObject = -1
Global Const acDataForm = 2
Global Const acFirst = 2
Global Const acGoTo = 4
Global Const acLast = 3
Global Const acNewRec = 5
Global Const acNext = 1
Global Const acPrevious = 0
//}}}
!!!Remarks
*The //~GoToRecord// action is most often started from an event. Clicking on a button in a form triggering the event might change the focus from the current form to the form containing the button. This could not be the desired effect. In that case use the [[setFocus]] method on the //form//, before executing the //~GoToRecord// statement.
*An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before/after the first/last row, respectively.
*If {{{Record}}} = //acGoTo// then:
**If the {{{Offset}}} is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.
**If the given {{{Offset}}} is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, {{{Offset}}} = (-1) positions the cursor on the last row, {{{Offset}}} = (-2) indicates the next-to-last row, and so on.
*Before moving to the indicated record, the current record is saved if it was either being created or being updated.
*//~GoToRecord// returns {{{True}}} if the move was successful, {{{False}}} otherwise.
!!!Error messages
|No active form or control found |
!!!See also
[[setFocus]]
!!!Example
<<tiddler "Gotorecord example">>
Jump to the 5th record before the last one
//{{{
GoToRecord , "myForm", acLast
GoToRecord , "myForm", acPrevious, 5
//}}}
{{firstletter{
@@color:#930;A@@
}}} //~GridControl// [[control|Control]] presents the records of a table or query in a tabular form.
!!!Functions returning a ~GridControl control
| !Function | !Type | !Arguments |!Description |
|[[Controls]] | [[Collection]] | Parent object<br />Integer or String |{{{Controls("myForm","myGridControl")}}} returns a control pseudo-object corresponding with the {{{myGridControl}}} control in the {{{myForm}}} form. {{{myForm}}} must be open. |
|[[getObject]] || String |{{{getObject("Forms!myForm!myGridControl")}}} returns a control pseudo-object corresponding with the {{{myGridControl}}} control in the {{{myForm}}} form. {{{myForm}}} must be open. |
!!!Properties
| !Property | !Type | !Read only |!Description or UNO object |
|[[Name]] || Y |Specifies the exact name of the control |
|BackColor |||Specifies the color of the interior of a control. |
|BorderColor |||Specifies the color of a control's border. |
|BorderStyle |||Specifies how a control's border appears. |
|[[ControlTipText]] |||Specifies the text that appears in a ~ScreenTip when you hold the mouse pointer over a control. |
|[[ControlType]] || Y |Specifies the type of a control. |
|[[Enabled]] |||Specifies if the cursor can access the control. |
|[[FontBold]]<br />[[FontItalic]]<br />[[FontName]]<br />[[FontSize]]<br />[[FontUnderline]]<br />[[FontWeight]]<br />[[ForeColor]] |||Specify the font characteristics. |
|[[TabIndex]] |||Specifies a control's place in the tab order on a form. |
|[[TabStop]] |||Specifies whether you can use the TAB key to move the focus to a control. |
|[[Tag]] |||Stores extra information about a control. |
|[[Visible]] |||Specifies if a control is visible or hidden. |
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the ~SubForm has the given property. |
!!!Remarks
Each //~GridControl// [[control pseudo-object|Pseudo Object]] has a Controls [[collection|Collection]], which contains all controls on the gridcontrol. You can refer to a specific control on a gridcontrol by referring to the [[Controls]] collection.
!!!Example
<<tiddler "Gridcontrol examples">>
Change font properties for ALL fields in a gridcontrol
//{{{
Dim ocGrid As Object
Set ocGrid = Controls("myForm", "myGridControl")
setFontBold(ocGrid, True)
//}}}
To know the controls present in a gridcontrol (datagrid)
//{{{
Dim i As Integer, iCountGrid As Integer
iCountGrid = Controls(ocGrid).Count
For i = 0 To iCountGrid - 1
Print getName(Controls(ocGrid, i)),
Next i
Print
//}}}
The //Height// property specifies the height of a form
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
!!!Syntax
//form//{{{.Height}}}
{{{getHeight(}}}//form//{{{)}}}
{{{setHeight(}}}//form//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Integer}}} or {{{Long}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[Maximize]]
[[Minimize]]
[[Move]]
[[Width]]
!!!Example
<<tiddler "Height & Width example">>
Modify height and width of a form
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
setHeight(ofForm, 300)
setWidth(ofForm, 200)
//}}}
!What is __~Access2Base__ ?
{{firstletter{
@@color:#930;A@@
}}}''ccess2Base'' is an ~OpenOffice/~LibreOffice extension for (business or personal) __application developers__ and __advanced users__.
It provides a ~OOo/~LibO Basic library of macros implementing a number of functionalities - directly inspired by //~MSAccess//. The macros are callable from an ''~OpenOffice/~LibreOffice Base'' application.
It is intended first to support people having a knowledge of ~MSAccess and willing to step over to a similar but free software, i.e. //~OpenOffice/~LibreOffice Base//. It is also useful for users having already a practical knowledge of ~OpenOffice/~LibreOffice and want to start building applications with it, while remaining focussed on the application or business logic only.
//It is also recommended to people having tried to program in ~OOo/~LibO Basic with the standard ~OpenOffice/~LibreOffice API and having given it up ...//
The implemented macros include:
>1. a simplified and extensible ''__API__'' for [[forms|Forms]] and [[controls|Controls]] manipulations derived from the //~MSAccess// object model
>2. a number of actions with a syntax identical to their corresponding //~MSAccess// macros/actions
>3. the DLookup, DSum, ... database functions
>4. the support of the [[shortcut|ShortCut Notation]] notations like {{{Forms!myForm!myControl}}}
+
>5. a consistent [[errors and exceptions handler|Error Handler]]
>6. facilities for management of [[form and control events|Events Handler]]
!Compare ~Access2Base with ~MSAccess VBA
<<tiddler "Access2Base vs. VBA">>
!To know more ...
[[Why Access2Base ?]]
The [[Pseudo-Object model|Pseudo Object]]
!What you can do ...
[[Download the extension and get started|DownLoad]]
Browse the [[User's Guide]]
/***
|Name|InlineJavascriptPlugin|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.6|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|Insert Javascript executable code directly into your tiddler content.|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Documentation
>see [[InlineJavascriptPluginInfo]]
!!!!!Revisions
<<<
2010.12.15 1.9.6 allow (but ignore) type="..." syntax
|please see [[InlineJavascriptPluginInfo]] for additional revision details|
2005.11.08 1.0.0 initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.InlineJavascriptPlugin= {major: 1, minor: 9, revision: 6, date: new Date(2010,12,15)};
config.formatters.push( {
name: "inlineJavascript",
match: "\\<script",
lookahead: "\\<script(?: type=\\\"[^\\\"]*\\\")?(?: src=\\\"([^\\\"]*)\\\")?(?: label=\\\"([^\\\"]*)\\\")?(?: title=\\\"([^\\\"]*)\\\")?(?: key=\\\"([^\\\"]*)\\\")?( show)?\\>((?:.|\\n)*?)\\</script\\>",
handler: function(w) {
var lookaheadRegExp = new RegExp(this.lookahead,"mg");
lookaheadRegExp.lastIndex = w.matchStart;
var lookaheadMatch = lookaheadRegExp.exec(w.source)
if(lookaheadMatch && lookaheadMatch.index == w.matchStart) {
var src=lookaheadMatch[1];
var label=lookaheadMatch[2];
var tip=lookaheadMatch[3];
var key=lookaheadMatch[4];
var show=lookaheadMatch[5];
var code=lookaheadMatch[6];
if (src) { // external script library
var script = document.createElement("script"); script.src = src;
document.body.appendChild(script); document.body.removeChild(script);
}
if (code) { // inline code
if (show) // display source in tiddler
wikify("{{{\n"+lookaheadMatch[0]+"\n}}}\n",w.output);
if (label) { // create 'onclick' command link
var link=createTiddlyElement(w.output,"a",null,"tiddlyLinkExisting",wikifyPlainText(label));
var fixup=code.replace(/document.write\s*\(/gi,'place.bufferedHTML+=(');
link.code="function _out(place,tiddler){"+fixup+"\n};_out(this,this.tiddler);"
link.tiddler=w.tiddler;
link.onclick=function(){
this.bufferedHTML="";
try{ var r=eval(this.code);
if(this.bufferedHTML.length || (typeof(r)==="string")&&r.length)
var s=this.parentNode.insertBefore(document.createElement("span"),this.nextSibling);
if(this.bufferedHTML.length)
s.innerHTML=this.bufferedHTML;
if((typeof(r)==="string")&&r.length) {
wikify(r,s,null,this.tiddler);
return false;
} else return r!==undefined?r:false;
} catch(e){alert(e.description||e.toString());return false;}
};
link.setAttribute("title",tip||"");
var URIcode='javascript:void(eval(decodeURIComponent(%22(function(){try{';
URIcode+=encodeURIComponent(encodeURIComponent(code.replace(/\n/g,' ')));
URIcode+='}catch(e){alert(e.description||e.toString())}})()%22)))';
link.setAttribute("href",URIcode);
link.style.cursor="pointer";
if (key) link.accessKey=key.substr(0,1); // single character only
}
else { // run script immediately
var fixup=code.replace(/document.write\s*\(/gi,'place.innerHTML+=(');
var c="function _out(place,tiddler){"+fixup+"\n};_out(w.output,w.tiddler);";
try { var out=eval(c); }
catch(e) { out=e.description?e.description:e.toString(); }
if (out && out.length) wikify(out,w.output,w.highlightRegExp,w.tiddler);
}
}
w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
}
}
} )
//}}}
// // Backward-compatibility for TW2.1.x and earlier
//{{{
if (typeof(wikifyPlainText)=="undefined") window.wikifyPlainText=function(text,limit,tiddler) {
if(limit > 0) text = text.substr(0,limit);
var wikifier = new Wikifier(text,formatter,null,tiddler);
return wikifier.wikifyPlain();
}
//}}}
// // GLOBAL FUNCTION: $(...) -- 'shorthand' convenience syntax for document.getElementById()
//{{{
if (typeof($)=='undefined') { function $(id) { return document.getElementById(id.replace(/^#/,'')); } }
//}}}
/***
|Name|InlineJavascriptPluginInfo|
|Source|http://www.TiddlyTools.com/#InlineJavascriptPlugin|
|Documentation|http://www.TiddlyTools.com/#InlineJavascriptPluginInfo|
|Version|1.9.6|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|Documentation for InlineJavascriptPlugin|
''Call directly into TW core utility routines, define new functions, calculate values, add dynamically-generated ~TiddlyWiki-formatted output'' into tiddler content, or perform any other programmatic actions each time the tiddler is rendered.
!!!!!Usage
<<<
This plugin adds wiki syntax for surrounding tiddler content with {{{<script>}}} and {{{</script>}}} markers, so that it can be recognized as embedded javascript code. When a tiddler is rendered, the plugin automatically invokes any embedded scripts, which can be used to construct and return dynamically-generated output that is inserted into the tiddler content.
{{{
<script type="..." src="..." label="..." title="..." key="..." show>
/* javascript code goes here... */
</script>
}}}
All parameters are //optional//. When the ''show'' keyword is used, the plugin will also include the script source code in the output that it displays in the tiddler. This is helpful when creating examples for documentation purposes (such as used in this tiddler!)
__''Deferred execution from an 'onClick' link''__
<script label="click here" title="mouseover tooltip text" key="X" show>
/* javascript code goes here... */
alert('you clicked on the link!');
</script>
By including a {{{label="..."}}} parameter in the initial {{{<script>}}} marker, the plugin will create a link to an 'onclick' script that will only be executed when that specific link is clicked, rather than running the script each time the tiddler is rendered. You may also include a {{{title="..."}}} parameter to specify the 'tooltip' text that will appear whenever the mouse is moved over the onClick link text, and a {{{key="X"}}} parameter to specify an //access key// (which must be a //single// letter or numeric digit only).
__''Loading scripts from external source files''__
<script src="URL" show>
/* optional javascript code goes here... */
</script>You can also load javascript directly from an external source URL, by including a src="..." parameter in the initial {{{<script>}}} marker (e.g., {{{<script src="demo.js"></script>}}}). This is particularly useful when incorporating third-party javascript libraries for use in custom extensions and plugins. The 'foreign' javascript code remains isolated in a separate file that can be easily replaced whenever an updated library file becomes available.
In addition to loading the javascript from the external file, you can also use this feature to invoke javascript code contained within the {{{<script>...</script>}}} markers. This code is invoked //after// the external script file has been processed, and can make immediate use of the functions and/or global variables defined by the external script file.
>Note: To ensure that your javascript functions are always available when needed, you should load the libraries from a tiddler that is rendered as soon as your ~TiddlyWiki document is opened, such as MainMenu. For example: put your {{{<script src="..."></script>}}} syntax into a separate 'library' tiddler (e.g., ~LoadScripts), and then add {{{<<tiddler LoadScripts>>}}} to MainMenu so that the library is loaded before any other tiddlers that rely upon the functions it defines.
>
>Normally, loading external javascript in this way does not produce any direct output, and should not have any impact on the appearance of your MainMenu. However, if your ~LoadScripts tiddler contains notes or other visible content, you can suppress this output by using 'inline CSS' in the MainMenu, like this: {{{@@display:none;<<tiddler LoadScripts>>@@}}}
<<<
!!!!!Creating dynamic tiddler content and accessing the ~TiddlyWiki DOM
<<<
An important difference between ~TiddlyWiki inline scripting and conventional embedded javascript techniques for web pages is the method used to produce output that is dynamically inserted into the document: in a typical web document, you use the {{{document.write()}}} (or {{{document.writeln()}}}) function to output text sequences (often containing HTML tags) that are then rendered when the entire document is first loaded into the browser window.
However, in a ~TiddlyWiki document, tiddlers (and other DOM elements) are created, deleted, and rendered "on-the-fly", so writing directly to the global 'document' object does not produce the results you want (i.e., replacing the embedded script within the tiddler content), and instead will //completely replace the entire ~TiddlyWiki document in your browser window (which is clearly not a good thing!)//. In order to allow scripts to use {{{document.write()}}}, the plugin automatically converts and buffers all HTML output so it can be safely inserted into your tiddler content, immediately following the script.
''Note that {{{document.write()}}} can only be used to output "pure HTML" syntax. To produce //wiki-formatted// output, your script should instead return a text value containing the desired wiki-syntax content'', which will then be automatically rendered immediately following the script. If returning a text value is not sufficient for your needs, the plugin also provides an automatically-defined variable, 'place', that gives the script code ''direct access to the //containing DOM element//'' into which the tiddler output is being rendered. You can use this variable to ''perform direct DOM manipulations'' that can, for example:
* generate wiki-formatted output using {{{wikify("...content...",place)}}}
* vary the script's actions based upon the DOM element in which it is embedded
* access 'tiddler-relative' DOM information using {{{story.findContainingTiddler(place)}}}
Note:
''When using an 'onclick' script, the 'place' element actually refers to the onclick //link text// itself, instead of the containing DOM element.'' This permits you to directly reference or modify the link text to reflect any 'stateful' conditions that might set by the script. To refer to the containing DOM element from within an 'onclick' script, you can use "place.parentNode" instead.
<<<
!!!!!Instant "bookmarklets"
<<<
You can also use an 'onclick' link to define a "bookmarklet": a small piece of javascript that can be ''invoked directly from the browser without having to be defined within the current document.'' This allows you to create 'stand-alone' commands that can be applied to virtually ANY ~TiddlyWiki document... even remotely-hosted documents that have been written by others!! To create a bookmarklet, simply define an 'onclick' script and then grab the resulting link text and drag-and-drop it onto your browser's toolbar (or right-click and use the 'bookmark this link' command to add it to the browser's menu).
Notes:
*When writing scripts intended for use as bookmarklets, due to the ~URI-encoding required by the browser, ''you cannot not use ANY double-quotes (") within the bookmarklet script code.''
*All comments embedded in the bookmarklet script must ''use the fully-delimited {{{/* ... */}}} comment syntax,'' rather than the shorter {{{//}}} comment syntax.
*Most importantly, because bookmarklets are invoked directly from the browser interface and are not embedded within the ~TiddlyWiki document, there is NO containing 'place' DOM element surrounding the script. As a result, ''you cannot use a bookmarklet to generate dynamic output in your document,'' and using {{{document.write()}}} or returning wiki-syntax text or making reference to the 'place' DOM element will halt the script and report a "Reference Error" when that bookmarklet is invoked.
Please see ~InstantBookmarklets for many examples of 'onclick' scripts that can also be used as bookmarklets.
<<<
!!!!!Special reserved function name
<<<
The plugin 'wraps' all inline javascript code inside a function, {{{_out()}}}, so that any return value you provide can be correctly handled by the plugin and inserted into the tiddler. To avoid unpredictable results (and possibly fatal execution errors), this function should never be redefined or called from ''within'' your script code.
<<<
!!!!!$(...) 'shorthand' function
<<<
As described by Dustin Diaz [[here|http://www.dustindiaz.com/top-ten-javascript/]], the plugin defines a 'shorthand' function that allows you to write:
{{{
$(id)
}}}
in place of the normal standard javascript syntax:
{{{
document.getElementById(id)
}}}
This function is provided merely as a convenience for javascript coders that may be familiar with this abbreviation, in order to allow them to save a few bytes when writing their own inline script code.
<<<
!!!!!Examples
<<<
simple dynamic output:
><script show>
document.write("The current date/time is: "+(new Date())+"<br>");
return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
dynamic output using 'place' to get size information for current tiddler:
><script show>
if (!window.story) window.story=window;
var title=story.findContainingTiddler(place).getAttribute("tiddler");
var size=store.getTiddlerText(title).length;
return title+" is using "+size+" bytes";
</script>
dynamic output from an 'onclick' script, using {{{document.write()}}} and/or {{{return "..."}}}
><script label="click here" show>
document.write("<br>The current date/time is: "+(new Date())+"<br>");
return "link to current user: [["+config.options.txtUserName+"]]\n";
</script>
creating an 'onclick' button/link that accesses the link text AND the containing tiddler:
><script label="click here" title="clicking this link will show an 'alert' box" key="H" show>
if (!window.story) window.story=window;
var txt=place.firstChild.data;
var tid=story.findContainingTiddler(place).getAttribute('tiddler');
alert('Hello World!\nlinktext='+txt+'\ntiddler='+tid);
</script>
dynamically setting onclick link text based on stateful information:
>{{block{
{{{
<script label="click here">
/* toggle "txtSomething" value */
var on=(config.txtSomething=="ON");
place.innerHTML=on?"enable":"disable";
config.txtSomething=on?"OFF":"ON";
return "\nThe current value is: "+config.txtSomething;
</script><script>
/* initialize onclick link text based on current "txtSomething" value */
var on=(config.txtSomething=="ON");
place.lastChild.previousSibling.innerHTML=on?"disable":"enable";
</script>
}}}
<script label="click here">
/* toggle "txtSomething" value */
var on=(config.txtSomething=="ON");
place.innerHTML=on?"enable":"disable";
config.txtSomething=on?"OFF":"ON";
return "\nThe current value is: "+config.txtSomething;
</script><script>
/* initialize onclick link text based on current "txtSomething" value */
var on=(config.txtSomething=="ON");
place.lastChild.innerHTML=on?"enable":"disable";
</script>
}}}
loading a script from a source url:
>http://www.TiddlyTools.com/demo.js contains:
>>{{{function inlineJavascriptDemo() { alert('Hello from demo.js!!') } }}}
>>{{{displayMessage('InlineJavascriptPlugin: demo.js has been loaded');}}}
>note: When using this example on your local system, you will need to download the external script file from the above URL and install it into the same directory as your document.
>
><script src="demo.js" show>
return "inlineJavascriptDemo() function has been defined"
</script>
><script label="click to invoke inlineJavascriptDemo()" key="D" show>
inlineJavascriptDemo();
</script>
<<<
!!!!!Revisions
<<<
2010.12.15 1.9.6 allow (but ignore) type="..." syntax
2009.04.11 1.9.5 pass current tiddler object into wrapper code so it can be referenced from within 'onclick' scripts
2009.02.26 1.9.4 in $(), handle leading '#' on ID for compatibility with ~JQuery syntax
2008.06.11 1.9.3 added $(...) function as 'shorthand' for document.getElementById()
2008.03.03 1.9.2 corrected fallback declaration of wikifyPlainText() (fixes Safari "parse error")
2008.02.23 1.9.1 in onclick function, use string instead of array for 'bufferedHTML' (fixes IE errors)
2008.02.21 1.9.0 output from 'onclick' scripts (return value or document.write() calls) are now buffered and rendered into into a span following the script. Also, added default 'return false' handling if no return value provided (prevents HREF from being triggered -- return TRUE to allow HREF to be processed). Thanks to Xavier Verges for suggestion and preliminary code.
2008.02.14 1.8.1 added backward-compatibility for use of wikifyPlainText() in ~TW2.1.3 and earlier
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.28 1.8.0 added support for key="X" syntax to specify custom access key definitions
2007.12.15 1.7.0 autogenerate URI encoded HREF on links for onclick scripts. Drag links to browser toolbar to create bookmarklets. IMPORTANT NOTE: place is NOT defined when scripts are used as bookmarklets. In addition, double-quotes will cause syntax errors. Thanks to ~PaulReiber for debugging and brainstorming.
2007.11.26 1.6.2 when converting "document.write()" function calls in inline code, allow whitespace between "write" and "(" so that "document.write ( foobar )" is properly converted.
2007.11.16 1.6.1 when rendering "onclick scripts", pass label text through wikifyPlainText() to parse any embedded wiki-syntax to enable use of HTML entities or even TW macros to generate dynamic label text.
2007.02.19 1.6.0 added support for title="..." to specify mouseover tooltip when using an onclick (label="...") script
2006.10.16 1.5.2 add newline before closing '}' in 'function out_' wrapper. Fixes error caused when last line of script is a comment.
2006.06.01 1.5.1 when calling wikify() on script return value, pass hightlightRegExp and tiddler params so macros that rely on these values can render properly
2006.04.19 1.5.0 added 'show' parameter to force display of javascript source code in tiddler output
2006.01.05 1.4.0 added support 'onclick' scripts. When label="..." param is present, a button/link is created using the indicated label text, and the script is only executed when the button/link is clicked. 'place' value is set to match the clicked button/link element.
2005.12.13 1.3.1 when catching eval error in IE, e.description contains the error text, instead of e.toString(). Fixed error reporting so IE shows the correct response text. Based on a suggestion by ~UdoBorkowski
2005.11.09 1.3.0 for 'inline' scripts (i.e., not scripts loaded with src="..."), automatically replace calls to 'document.write()' with 'place.innerHTML+=' so script output is directed into tiddler content. Based on a suggestion by ~BradleyMeck
2005.11.08 1.2.0 handle loading of javascript from an external URL via src="..." syntax
2005.11.08 1.1.0 pass 'place' param into scripts to provide direct DOM access
2005.11.08 1.0.0 initial release
<<<
You can use the //IsLoaded// property to specify if a form is currently loaded.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |A form, either open or not |
!!!Syntax
//form//{{{.IsLoaded}}}
{{{getIsLoaded(}}}//form//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
The //~IsLoaded// property is read-only
!!!Error messages
|Argument nr.X is invalid |
!!!See also
!!!Example
<<tiddler "IsLoaded example">>
List all forms and specify which ones are open
//{{{
Dim ofForm As Object, iCount As Integer, i As Integer
iCount = AllForms.Count
For i = 0 To iCount - 1
Set ofForm = AllForms(i)
With ofForm
Print "Form " & .pName & " is " & Iif(.IsLoaded, "", "NOT ") & "open"
End With
Next i
Print
//}}}
The //~ItemData// property returns the data in the bound column for the specified row in a combo box or list box.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[ComboBox]]<br />[[ListBox]] | [[ComboBox]]<br />[[ListBox]] |A combo- or listbox on an open form or in a [[GridControl]]|
!!!Syntax
//control//{{{.ItemData}}}
{{{getItemData(}}}//control//{{{)}}}
//control//{{{.ItemData(index)}}}
{{{getItemData(}}}//control, index//{{{)}}}
!!!Returned values / Arguments
{{{Array of Strings}}} (might be empty) if index is absent
{{{String}}} (might be null string) if index is present
!!!Remarks
The //~ItemData// property is read-only.
The //index// argument must have a (integer or long) value between 0 and (//~ListCount// - 1)
!!!Error messages
|Argument nr.X is invalid |
|Property '~ItemData' not applicable in this context |
|Out of array range or incorrect array size for property '~ItemData'|
!!!See also
[[ListCount]]
[[ListIndex]]
[[MultiSelect]]
[[RowSource]]
[[RowSourceType]]
[[Selected]]
!!!Example
*Combo box
<<tiddler "ComboBox example">>
*List box
<<tiddler "ListBox example">>
You can use the ~LinkChildFields property (along with the LinkMasterFields property) together to know how the records in a form are linked to records in a subform.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[SubForm]] | None |A subform of an open form or another subform |
!!!Syntax
//control//{{{.LinkChildFields}}}
//control//{{{.LinkChildFields(index)}}}
{{{getLinkChildFields(}}}//control, //{{{index)}}}
!!!Returned values
Array of {{{Strings}}}
!!!Remarks
The ~LinkChildFields property is read-only.
The array can be empty. In this case the {{{UBound()}}} function will return {{{-1}}}.
!!!Error messages
|Argument nr.X is invalid |
|Property '~LinkChildFields' not applicable in this context |
|Out of array range or incorrect array size for property '~LinkChildFields' |
!!!See also
[[LinkMasterFields]]
!!!Example
<<tiddler "Linkfields example">>
You can use the ~LinkMasterFields property (along with the LinkChildFields property) together to know how the records in a form are linked to records in a subform.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[SubForm]] | None |A subform of an open form or another subform |
!!!Syntax
//control//{{{.LinkMasterFields}}}
//control//{{{.LinkMasterFields(index)}}}
{{{getLinkMasterFields(}}}//control, //{{{index)}}}
!!!Returned values
Array of {{{Strings}}}
!!!Remarks
The ~LinkMasterFields property is read-only.
The array can be empty. In this case the {{{UBound()}}} function will return {{{-1}}}.
!!!Error messages
|Argument nr.X is invalid |
|Property '~LinkMasterFields' not applicable in this context |
|Out of array range or incorrect array size for property '~LinkMasterFields' |
!!!See also
[[LinkChildFields]]
!!!Example
<<tiddler "Linkfields example">>
List all the master / children fields of a subform
//{{{
Dim ocSubform As Object, i As Integer, iCount As Integer
Set ocSubform = getValue("Forms!myForm!mySubform.Form")
iCount = UBound(ocSubform.LinkMasterFields)
For i = 0 To iCount
Print "Master " & getLinkMasterFields(ocSubform, i) & " is linked to " _
& getLinkChildFields(ocSubform, i),
Next i
Print
//}}}
{{firstletter{
@@color:#930;A@@
}}} //~ListBox// describes a list box control. It has specific properties to manage the input list of potential values and to select one or more of them programmatically.
A ~ListBox control is returned by the [[Controls]] collection or by the [[getObject]] shortcut.
!!!Specific properties for list box management
| !Property | !Type | !Read only | !Description |
|[[ItemData]] || Y |Returns the data for the specified row in a combo box or list box. |
|[[ListCount]] || Y |Determines the number of rows in a ~ListBox or the list box portion of a [[ComboBox]]. |
|[[ListIndex]] |||Determines which item is selected in a ~ListBox or a [[ComboBox]]. |
|[[MultiSelect]] |||Specifies whether a user can make multiple selections in a ~ListBox on a form. |
|[[RowSource]] |||Specifies the source of the data in a ~ListBox or a [[ComboBox]]. |
|[[RowSourceType]] |||Specifies the source (tablename, queryname or SQL statement) of the data in a ~ListBox or a [[ComboBox]]. |
|[[Selected]] |||Specifies if an item in the data proposed by a ~ListBox is currently selected. |
|[[Value]] |||Specifies the value contained in the (~MultiSelect = False !) ~ListBox. |
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the ~ListBox has the given property. |
|[[Requery]] || Boolean |True if data reloaded in ~ListBox |
!!!Remarks
!!!See also
[[ComboBox]]
!!!Example
<<tiddler "ListBox example">>
//{{{
REM Display the selected rows of a (multiselect) listbox
Dim i As Integer, ocList As Object
Set ocList = getObject("Forms!myForm!myListBox")
For i = 0 To ocList.ListCount - 1
If ocList.Selected(i) Then Print i & " - " & ocList.ItemData(i),
Next i
REM Select all options
For i = 0 To ocList.ListCount - 1
setSelected(ocList, True, i)
Next i
Print
//}}}
You can use the //~ListCount property// to determine the number of rows in a list box or the list box portion of a combo box.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[ComboBox]]<br />[[ListBox]] | [[ComboBox]]<br />[[ListBox]] |A combo- or listbox on an open form or in a [[GridControl]]|
!!!Syntax
//control//{{{.ListCount}}}
{{{getListCount(}}}//control//{{{)}}}
!!!Returned values
{{{Long}}}
!!!Remarks
The //~ListCount// property is read-only.
!!!Error messages
|Argument nr.X is invalid |
|Property '~ListCount' not applicable in this context |
!!!See also
[[ItemData]]
[[ListIndex]]
[[MultiSelect]]
[[RowSource]]
[[RowSourceType]]
[[Selected]]
!!!Example
*Combo box
<<tiddler "ComboBox example">>
*List box
<<tiddler "ListBox example">>
You can use the //~ListIndex// property to determine which item is selected in a list box or combo box.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[ComboBox]]<br />[[ListBox]] | [[ComboBox]]<br />[[ListBox]] |A combo- or listbox on an open form or in a [[GridControl]]|
!!!Syntax
//control//{{{.ListIndex}}}
{{{getListIndex(}}}//control//{{{)}}}
{{{setListIndex(}}}//control, value//{{{)}}}
!!!Returned values / Arguments
{{{Long}}} in interval [0, //~ListCount// - 1]
!!!Remarks
If the control is a [[MultiSelect]] listbox, or if there is no item selected, then the //~ListIndex// property returns {{{-1}}}
!!!Error messages
|Argument nr.X is invalid |
|Property '~ListIndex' not applicable in this context |
|Value '...' is invalid for property '~ListIndex' |
!!!See also
[[ItemData]]
[[ListCount]]
[[MultiSelect]]
[[RowSource]]
[[RowSourceType]]
[[Selected]]
!!!Example
*Combo box
<<tiddler "ComboBox example">>
*List box
<<tiddler "ListBox example">>
The //Locked// property specifies if the control is read only.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |[[ComboBox]]<br />~CurrencyField<br />~DateField<br />~FileControl<br />~FormattedField<br />~ImageControl<br />[[ListBox]]<br />~NumericField<br />~PatternField<br />~TextField<br />~TimeField | All except<br />--~CheckBox-- |A control on an open form |
!!!Syntax
//control//{{{.Locked}}}
{{{getLocked(}}}//control//{{{)}}}
{{{setLocked(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property 'Locked' not applicable in this context |
!!!See also
[[Enabled]]
!!!Example
<<tiddler "Enabled & Locked example">>
//[[Software Version: 0.7.1|ReleaseNotes]]//
[[Home|Home]]
<<search>>
[[Index|Index]]
[[Download|DownLoad]]
<<tagsTree Menu>>
[[Thanks|Thanks]]
<<toggleSideBar "" "Toggle side bar" hide>>
{{firstletter{
@@color:#930;T@@
}}}he //Maximize// [[action|Actions]] maximizes the window containing the [[Form]] having the focus.
!!!Syntax
{{{Maximize()}}}
!!!Remarks
*The //Maximize// action requires ''at least version 3.3 of ~OpenOffice''.
*The //Maximize// action is usually preceded by a [[setFocus]] method applied on the targetted //form//.
*//Maximize// returns {{{True}}} if the action was successful, {{{False}}} otherwise.
*Caveat: The //Maximize// action makes the [[Width]] and [[Height]] properties of any [[pseudo-object|Pseudo Object]] describing the impacted //form// invalid. See example to discover how to restore them.
!!!Error messages
|No active form or control found |
!!!See also
[[Minimize]]
[[setFocus]]
!!!Example
<<tiddler "Maximize example">>
Set focus on targetted form and maximize it
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
setFocus(ofForm)
Maximize() ' ... or Minimize() ...
Set ofForm = Forms("myForm")
MsgBox ofForm.Width
//}}}
{{firstletter{
@@color:#930;T@@
}}}he //Minimize// [[action|Actions]] minimizes the window containing the [[Form]] having the focus.
!!!Syntax
{{{Minimize()}}}
!!!Remarks
*The //Minimize// action requires ''at least version 3.3 of ~OpenOffice''.
*The //Minimize// action is usually preceded by a [[setFocus]] method applied on the targetted //form//.
*//Minimize// returns {{{True}}} if the action was successful, {{{False}}} otherwise.
*Caveat: The //Minimize// action makes the [[Width]] and [[Height]] properties of any [[pseudo-object|Pseudo Object]] describing the impacted //form// invalid. See example to discover how to restore them.
!!!Error messages
|No active form or control found |
!!!See also
[[Maximize]]
[[setFocus]]
!!!Example
<<tiddler "Maximize example">>
The //Move// method moves the specified object to the coordinates specified by the argument values.
!!!Applies to ...
| !Object | !Description |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice// database form |
!!!Syntax
{{{Move(}}}//form//{{{, }}}//Left//{{{[, }}}//Top//{{{][, }}}//Width//{{{][, }}}//Height//{{{])}}}
| !Argument | !Type | !Description | !Returned value |
| form |[[Form object|Form]] |Form to be moved |//True// if success. |
| Left | Integer<br />Long |The screen position for the left edge of the form relative to the left edge of the screen |~|
| Top | Integer<br />Long |The screen position for the top edge of the form relative to the top edge of the screen |~|
| Width | Integer<br />Long |The desired width of the form |~|
| Height | Integer<br />Long |The desired height of the form |~|
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[Height]]
[[MoveSize]]
[[Width]]
!!!Example
<<tiddler "Move example">>
Move a form to new left-top coordinates and resize it ...
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
Move(ofForm, 100, 200, 500, 200)
//}}}
The //MoveSize// [[action|Actions]] moves the active window to the coordinates specified by the argument values.
!!!Syntax
{{{MoveSize(}}}//Right//{{{[, }}}//Down//{{{, }}}//Width//{{{, }}}//Height//
| !Argument | !Optional | !Type | !Description | !Returned value |
| Right | Yes |Integer<br />Long |The screen position for the left edge of the window relative to the left edge of the screen | True if success |
| Down |~| Integer<br />Long |The screen position for the top edge of the window relative to the top edge of the screen |~|
| Width |~| Integer<br />Long |The desired width of the window |~|
| Height |~| Integer<br />Long |The desired height of the window |~|
!!!Remarks
*The action applies to the active window. A window may be made active with [[SelectObject]] action.
*The //~MoveSize// action is also applicable to the Basic IDE window or the database window. However it will ignore any window opened by another application than Base.
*The [[Move]] method applies to [[forms|Form]] only.
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[Height]]
[[Move]]
[[SelectObject]]
[[Width]]
!!!Example
<<tiddler "MoveSize example">>
Select an open form and resize it
//{{{
SelectObject(acForm, "myForm")
MoveSize 100, 200, 500, 200
//}}}
You can use the ~MultiSelect property to specify whether a user can make multiple selections in a list box on a form
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[ListBox]] | None |A listbox on an open form |
!!!Syntax
//control//{{{.MultiSelect}}}
{{{getMultiSelect(}}}//control//{{{)}}}
!!!Returned values
{{{Boolean}}}
!!!Remarks
The //~MultiSelect// property is read-only.
In ~MSAccess VBA the //~MultiSelect// property returns an integer value.
!!!Error messages
|Argument nr.X is invalid |
|Property '~MultiSelect' not applicable in this context |
!!!See also
[[ItemData]]
[[ListCount]]
[[ListIndex]]
[[RowSource]]
[[RowSourceType]]
[[Selected]]
!!!Example
*Combo box
<<tiddler "ComboBox example">>
*List box
<<tiddler "ListBox example">>
The //Name// property specifies the text string corresponding to the name of an object.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |A form, open or not |
|[[SubForm]] |A subform of an open form |
|[[Control]] |A control of an open form |
|[[OptionGroup]] |A group of radio buttons |
|[[Property]] |A property of a pseudo-object |
!!!Syntax
//form//{{{.pName}}}
{{{getName(}}}//form//{{{)}}}
//subform//{{{.pName}}}
{{{getName(}}}//subform//{{{)}}}
//control//{{{.pName}}}
{{{getName(}}}//control//{{{)}}}
//optiongroup//{{{.pName}}}
{{{getName(}}}//optiongroup//{{{)}}}
//property//{{{.pName}}}
{{{getName(}}}//property//{{{)}}}
!!!Returned values
{{{String}}}
!!!Remarks
*The Name property is read-only.
*As "Name" is a reserved word in ~OOo/~LibO Basic, use "pName" instead of "Name".
*The returned string contains the name of the object __as stored by ~OpenOffice/~LibreOffice Base__. In ~OpenOffice/~LibreOffice Base "myForm" is different from "MYFORM". At the opposite, in ~Access2Base, all references to a name as argument of a function are //''not case-sensitive''//.<br />Example: {{{Forms("myForm")}}} is identical to {{{Forms("MYFORM")}}}
!!!Error messages
|Argument nr.X is invalid |
!!!See also
!!!Example
<<tiddler "Name example">>
Display exact name of the first open form
Display all property names of that form
//{{{
Dim ofForm As Object, opProperty As Object, i As Integer
If Forms.Count > 0 Then
Set ofForm = Forms(0)
Print getName(ofForm),
For i = 0 To Properties(ofForm).Count - 1
Set opProperty = Properties(ofForm, i)
Print opProperty.pName,
Next i
End If
Print
//}}}
Type the text for 'Object Properties'
The //~OpenArgs// property determines the expression that was passed as argument of an [[OpenForm]] action.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
!!!Syntax
//form//{{{.OpenArgs}}}
{{{getOpenArgs(}}}//form//{{{)}}}
!!!Returned values
{{{Variant}}}
!!!Remarks
*The //~OpenArgs// property is read-only.
*Being a variant, the ~OpenArgs argument of the OpenForm action might contain a complex value allowing complex processing (see example).
*The //form// argument must be the [[pseudo-object|Pseudo Object]] returned by the OpenForm action. Otherwise the ~OpenArgs property always returns a zero-length string.
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[Tag]]
!!!Example
<<tiddler "OpenArgs example">>
In a 1st step open a form with the ~OpenArgs argument
//{{{
m ofForm As Object
Const acNormal = 0
Set ofForm = OpenForm("myForm", acNormal, , , , , Array("MICKEY", "WINNIE"))
//}}}
In a 2nd step compute a filter based on the ~OpenArgs property
//{{{
Dim sFilter As String, i As Integer
sFilter = ""
For i = 0 To UBound(ofForm.OpenArgs)
sFilter = sFilter & Iif(i=0, "", " Or ") & "[EMPLOYEE].[NAME] LIKE '*" & ofForm.OpenArgs(i) & "*'"
Next i
setFilter(ofForm, sFilter)
setFilterOn(ofForm, True)
//}}}
{{firstletter{
@@color:#930;T@@
}}}he invocation of the //~OpenConnection// as a Sub is mandatory before any other use of the //~Access2Base// API. It establishes a link between the current database and all subsequent references to forms, etc. belonging to the current database document (".odb" file).
!!!Syntax
{{{Call OpenConnection(ThisDatabaseDocument, }}}//{{{Username, Password}}}//{{{)}}}
| !Argument | !Optional | !Type |!Description |
|{{{ThisDatabaseDocument}}} | No | com.sun.star.comp.dba.~ODatabaseDocument |Must be exactly spelled as is. |
|{{{Username}}} | Yes | String |The connection parameters to the effective database, if any. |
|{{{Password}}} |~|~|~|
!!!See also
[[Database]]
[[CurrentDb]]
[[DownLoad]]
!!!Example
The Call ~OpenConnection sentence is usually stored in the //~OpenDocument event// of the database document (".odb" file):
<<tiddler "Openconnection example">>
<<tiddler "CurrentDb example">>
{{firstletter{
@@color:#930;T@@
}}}he //~OpenForm// [[action|Actions]] opens a form in Form view or in form Design view. You can select data entry and window modes for the form and restrict the records that the form displays.
!!!Syntax
{{{OpenForm(}}}//{{{FormName, View, Filter, WhereCondition, DataMode, WindowMode, OpenArgs}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{FormName}}} | No | String |The name of the form to open. |
|{{{View}}} | Yes | acDesign<br />acNormal<br />acPreview |The view in which the form will open.<br />//acNormal// and //acPreview// are equivalent. Default is //acNormal//. |
|{{{Filter}}} |~| String |A valid __SQL WHERE clause__ (without the word WHERE). |
|{{{WhereCondition}}} |~| String |A valid __SQL WHERE clause__ (without the word WHERE). |
|{{{DataMode}}} |~| acFormAdd<br />acFormEdit<br />acFormPropertySettings<br />acFormReadOnly |Specifies if the user will be allowed to add new records (//acFormAdd//), add new and edit existing records (//acFormEdit//) or only read existing records (//acFormReadOnly//). //acFormPropertySettings// refers to the settings at form creation.<br />Only //acFormEdit// alows record deletions. |
|{{{WindowMode}}} |~| acHidden<br />acWindowNormal |Default is //acWindowNormal//. |
|{{{OpenArgs}}} |~| String |The string is used to set the form's [[OpenArgs]] property. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acDesign = 1
Global Const acNormal = 0
Global Const acPreview = 2
Global Const acFormAdd = 0
Global Const acFormEdit = 1
Global Const acFormPropertySettings = -1
Global Const acFormReadOnly = 2
Global Const acHidden = 1
Global Const acWindowNormal = 0
//}}}
!!!Remarks
*The //Filter// and //~WhereCondition// arguments are simply concatenated and applied as filter to the form:
//{{{
( Filter ) And ( WhereCondition )
//}}}
*The //~OpenForm// action returns a [[Form]] peudo-object.
*If the //view// argument is //acDesign//, the form will get opened in Design mode. However any further action is not supported by the ~Access2Base API.
!!!Error messages
|Form '...' could not be opened |
!!!See also
[[AllowAdditions]]
[[AllowDeletions]]
[[AllowEdits]]
[[Close]]
[[Filter]]
[[FilterOn]]
[[OpenArgs]]
[[OpenQuery]]
[[OpenReport]]
[[OpenTable]]
!!!Example
<<tiddler "Openform example">>
{{firstletter{
@@color:#930;T@@
}}}he //~OpenQuery// [[action|Actions]] opens a query in normal view or in query design view.
!!!Syntax
{{{OpenQuery(}}}//{{{QueryName, View, DataMode}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{QueryName}}} | No | String |The name of the query to open. This argument is NOT case-sensitive. |
|{{{View}}} | Yes | acViewDesign<br />acViewNormal<br />acViewPreview |The view in which the query will open.<br />//acViewNormal// and //acViewPreview// are equivalent. Default is //acViewNormal//. |
|{{{DataMode}}} |~| acEdit |The user will be allowed to add new records and edit existing records. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acViewDesign = 1
Global Const acViewNormal = 0
Global Const acViewPreview = 2
Global Const acEdit = 1
//}}}
!!!Remarks
If the //view// argument is //acDesign//, the query will get opened in Design mode. However any further action is not supported by the ~Access2Base API.
!!!Error messages
|Query '...' could not be opened |
|Query '...' not found |
!!!See also
[[Close]]
[[OpenForm]]
[[OpenReport]]
[[OpenTable]]
!!!Example
//{{{
OpenQuery("myQuery", acViewNormal)
//}}}
{{firstletter{
@@color:#930;T@@
}}}he //~OpenReport// [[action|Actions]] opens a report in normal view or in report design view.
!!!Syntax
{{{OpenReport(}}}//{{{ReportName, View}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{ReportName}}} | No | String |The name of the report to open. This argument is NOT case-sensitive. |
|{{{View}}} | Yes | acViewDesign<br />acViewNormal<br />acViewPreview |The view in which the query will open.<br />//acViewNormal// and //acViewPreview// are equivalent. Default is //acViewNormal//. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acViewDesign = 1
Global Const acViewNormal = 0
Global Const acViewPreview = 2
//}}}
!!!Remarks
*If the report was built with the Sun Report Builder extension, this extension is required to get the report open.
*If the //view// argument is //acDesign//, the query will get opened in Design mode. However any further action is not supported by the ~Access2Base API.
!!!Error messages
|Report '...' could not be opened |
|Report '...' not found |
!!!See also
[[Close]]
[[OpenForm]]
[[OpenQuery]]
[[OpenTable]]
!!!Example
//{{{
OpenQuery("myQuery", acViewNormal)
//}}}
{{firstletter{
@@color:#930;T@@
}}}he //~OpenTable// [[action|Actions]] opens a table in normal view or in table design view.
!!!Syntax
{{{OpenTable(}}}//{{{TableName, View, DataMode}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{TableName}}} | No | String |The name of the table to open. This argument is NOT case-sensitive. |
|{{{View}}} | Yes | acViewDesign<br />acViewNormal<br />acViewPreview |The view in which the table will open.<br />//acViewNormal// and //acViewPreview// are equivalent. Default is //acViewNormal//. |
|{{{DataMode}}} |~| acEdit |The user will be allowed to add new records and edit existing records. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acViewDesign = 1
Global Const acViewNormal = 0
Global Const acViewPreview = 2
Global Const acEdit = 1
//}}}
!!!Remarks
If the //view// argument is //acDesign//, the table will get opened in Design mode. However any further action is not supported by the ~Access2Base API.
!!!Error messages
|Table '...' could not be opened |
|Table '...' not found |
!!!See also
[[Close]]
[[OpenForm]]
[[OpenQuery]]
[[OpenReport]]
!!!Example
//{{{
OpenTable("myTable", acViewNormal)
//}}}
//{{{
Sub DBOpen(Optional poEvent As Object)
If GlobalScope.BasicLibraries.hasByName("Access2Base") then _
GlobalScope.BasicLibraries.LoadLibrary("Access2Base")
Call OpenConnection(ThisDatabaseDocument)
End Sub
//}}}
Open a form
//{{{
OpenForm "myForm"
//}}}
Open a form in read only mode
//{{{
OpenForm "myForm", , , , acFormReadOnly
//}}}
Open a form in read only mode. The form must be hidden.
//{{{
Dim ofForm As Object
ofForm = OpenForm "myForm", , , , acFormReadOnly, acHidden
//}}}
Make it later visible
//{{{
setVisible(ofForm, True)
//}}}
{{firstletter{
@@color:#930;A@@
}}}n //~OptionGroup// [[Pseudo-Object|Pseudo Object]] represents a set of [[RadioButton]] controls in a [[form|Form]] or a [[subform|SubForm]], having the same __name__. It is the name of the //radiobuttons// which makes them bound in the sense that selecting one button deselects automatically all the others.
Most properties can be set at //~RadioButton// level and individually for each of them. However the key reason for having introduced //~OptionGroups// (an artificial entity with no equivalent in //~OpenOffice/~LibreOffice//) in //~Access2Base// is giving the programmer an easy mean to determine which //~RadioButton// s currently selected.
!!!Functions returning an ~OptionGroup pseudo-object
| !Method | !Arg1 | !Arg2 |!Description |
|[[getOptionGroup]] | [[Form]]<br />[[SubForm]] | String |Returns an //~OptionGroup// pseudo object in the form or subform indicated by Arg1 having Arg2 as name. The name is the common name of all //radio buttons// belonging to the ~OptionGroup.|
!!!Properties
| !Property | !Read only | !Description or UNO object |
|[[Name]] | Y |Specifies the exact name of the option group. |
|[[Count]] | Y |Specifies the number of radio buttons belonging to the group. |
|[[Value]] ||Specifies the index of the radio button being currently selected. |
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the ~OptionGroup has the given property. |
!!!Remarks
The //Value// property holds a value between 0 and //Count// - 1.
!!!Example
<<tiddler "Optiongroup example">>
The //~OptionValue// property specifies the value stored in the database as determined by the selected [[RadioButton]].
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[RadioButton]] | None |A control on an open form. |
!!!Syntax
//control//{{{.OptionValue}}}
{{{getOptionValue(}}}//control//{{{)}}}
!!!Returned value
{{{String}}}
!!!Remarks
The //~OptionValue// property is read-only.
!!!Error messages
|Argument nr.1 is invalid |
!!!See also
[[RadioButton]]
[[OptionGroup]]
[[getOptionGroup]]
!!!Example
<<tiddler "Optionvalue example">>
Change the selected radio button and change its appearance
//{{{
Dim ofForm As Object, ocOptionGroup As Object, ocControl As Object, i as integer
Set ofForm = Forms("myform")
Set ocOptionGroup = getOptionGroup(ofForm, "myRadioButton")
setValue(ocOptionGroup, 2)
For i = 0 to ocOptionGroup.Count - 1
ocControl = Controls(ocOptionGroup, i)
If i = ocOptionGroup.Value Then
setForeColor(ocControl, RGB(255, 0 ,0))
Else
setForeColor(ocControl, RGB(0, 0 ,0))
End If
Next i
//}}}
<!--{{{-->
<div class='header'>
<div class='titleLine'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div macro='gradient vert #ffffff #cc9900'><a> </a><div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
</div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
The //Properties// collection describes instances of all __properties__ of a [[pseudo-object|Pseudo Object]]
!!!Syntax
{{{Properties(pseudo)}}}
{{{Properties(pseudo, index)}}} or {{{Properties(pseudo, propertyname)}}}
| !Argument #1 | !Type | !Argument #2 | !Type |!Returned value |
| pseudo | [[Pseudo Object]] || absent |A [[Collection]] of the properties of the pseudo-object |
|~|~| index | integer<br />long |A [[property|Property]] object |
|~|~| propertyname | string |~|
!!!Remarks
*Property [[collections|Collection]] are numbered from 0 to {{{Properties(...).Count - 1}}}
*The //propertyname// argument is not case sensitive.
!!!Error messages
|Argument nr.X is invalid |
|Out of array range or incorrect array size for collection Properties() |
!!!See also
[[Property]]
[[hasProperty]]
[[getProperty]]
[[setProperty]]
!!!Examples
<<tiddler "Properties example">>
To list the value of each property of a form ...
//{{{
Dim ofForm As Object, i As Integer, iCount As Integer, oProperty As Object
Set ofForm = Forms("myForm")
iCount = getCount(Properties(ofForm))
For i = 0 To iCount - 1
oProperty = Properties(ofForm, i)
Print getName(oProperty) & "=" & getValue(oProperty),
Next i
Print
//}}}
The {{{Property}}} [[pseudo-object|Pseudo Object]] describes a ~Name-Value pair of any property of any other object.
!!!Functions returning a property pseudo-object
| !Function | !Type |!Description |
|[[Properties]] | [[Collection]] |{{{Properties(}}}//object,property-name//{{{)}}} returns a //Property// pseudo-object. |
!!!Properties of the returned pseudo-object
| !Property | !Type | !Description |
|[[Name]] | String ||
|[[Value]] | Variant |the value of the considered property (might be an array). |
!!!Syntax
//property//{{{.pName}}}
{{{getName(}}}//property//{{{)}}}
//property//{{{.Value}}}
{{{getValue(}}}//property//{{{)}}}
!!!Remarks
*All properties are read-only.
!!!See also
[[Properties]]
[[hasProperty]]
[[getProperty]]
[[setProperty]]
!!!Example
<<tiddler "Properties example">>
{{firstletter{
@@color:#930;O@@
}}}Oo/~LibO Basic is not an object-oriented language.
To stay close to the syntax of the //~MSAccess// object model the implementation of ~Access2Base has been based on "pseudo-objects" or classes of pseudo-objects. Their main characteristics are (see below for more details):
*Use of variables of ''user-defined'' types. F.i. user-defined variables of the types Form, Subform or Control.
*Access to pseudo-object properties with a consistent syntax.
*Execution of methods with a consistent syntax.
*Support of indirection and introspection for properties.
Property and method names are identical in //~MSAccess// and in //~Access2Base// (with a few exceptions, see below). Note however that //~Access2Base// implements only a very limited subset of the object model of //~MSAccess//.
!User-defined type
The ~OOo/~LibO Basic documentation says as good as nothing about variables of user-defined types. Here a bit more about them thanks to an example.
The main thing to remember is that the scope of the definition of a user-defined type is the MODULE, not the library or more. The variable itself however can be local or global.
Nevertheless next code works very well.
//{{{
REM in module # 1
Type Coord
x As Double
y As Double
End Type
Sub Main()
Dim myCoord As Coord
setCoord(myCoord)
MsgBox myCoord.x
End Sub
//}}}
//{{{
REM in module # 2 (or in another library ...)
Sub setCoord(poCoord As Object)
poCoord.x = 50
poCoord.y = 100
End Sub
//}}}
In addition, variables of a user-defined type are as easy to "watch" in the IDE of ~OOo/~LibO Basic as any other variables. Even also if an element is declared as an Object and contains a UNO object !
!Pseudo-objects classes
The classes of pseudo-objects currently supported by the //~Access2Base// API are:
| !Class | !Description |
|[[Collection]] |An array of pseudo-objects accessible via their index |
|[[Database]] |The single database to which the Base application is connected |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice// database form |
|[[Control]] |The representation of a control within a Form |
|[[SubForm]] |Identifies a specific control which is a subform of a database form or another subform |
|[[Property]] |A name-value pair allowing pseudo-objects introspection (see below) |
|[[Event|Events]] |A description of an occurred form or control event |
!Collections - Functions returning pseudo-objects
Pseudo-objects are created by the invocation of specific functions included in the API. In the calling procedure a pseudo-object is defined as a variable of type //Object//.
Example:
//{{{
Dim ofForm As Object ' Variant would also be correct
Set ofForm = AllForms("myForm") ' The Set verb is mandatory in MSAccess but optional in OOo/LibO Basic
//}}}
{{{ofForm}}} contains after execution the description of a pseudo-object of class Form.
{{{AllForms}}} is called a [[collection|Collection]]. Individual members of a collection are reachable either by their index or by their name.
!Pseudo-objects validity
Except for the [[Database]] pseudo-object, all the other ones remain ''valid'', i.e. their properties contain valid information, at latest ''up to the next interaction with the end-user''.
This is essential to understand. Let's help with an example:
//{{{
Global ofForm As Object
Function TriggeredByEvent(...)
Set ofForm = AllForms("myForm")
If ofForm.IsLoaded Then ...
//}}}
[[IsLoaded]] is a property of type Boolean indicating if the form is currently open. The {{{ofForm}}} variable will keep its content, due to its global scope, up to a future reassignment. It must be clear to the applicaton developer that the [[IsLoaded]] property will not spontaneously become {{{False}}} if the end-user has closed manually the corresponding form between two subsequent uses of {{{ofForm}}}. __After each interaction with the end-user a new call to [[AllForms]] will be required__.
!Properties
!!!Property types
Within a pseudo-object class (to say it simpler: within a user-defined type ...) you can distinguish next property types:
| !Type of property | !Description |
|System |Starts with the underscore "_" character<br>Not to be used from outside the API |
|UNO |The property refers to a UNO (real!) object that can be used from user macros to call directly more sophisticated properties and methods than those supported by the API |
|Normal |Where it is really about in the ~Access2Base software |
!!!Property names
The names of the properties are identical to their equivalent in //~MSAccess//.
However
*when the name is a ''reserved word'' in ~OOo/~LibO Basic the name is preceded by a "p" (like in property). Typically //pName// and //pText// respectively replace //Name// and //Text//
*the semantics of the property might differ more or less
*the list of allowed values might be different
Read the documentation about each individual property for more info.
!!!Get properties
To get the value of a __normal__ (pseudo-)property, it is strictly equivalent to write
{{indent{{{{vValue = myObject.MyProperty}}}
or
{{indent{{{{vValue = getMyProperty(myObject)}}}
Depending on the context an error message can be generated stopping the execution of the macro. The error message can be issued either by ~OOo/~LibO Basic or by the API.
If the property is an array use either
{{indent{{{{vValue = myObject.MyArrayProperty(i)}}}
or
{{indent{{{{vValue = getMyArrayProperty(myObject, i)}}}
!!!Set properties
To set the value of a __normal__ property, only next syntax is allowed:
{{indent{{{{setMyProperty(myObject, vValue[, i])}}}
the third optional argument being the index if the property returns an array.
The macro will be stopped if the property setting failed.
!!!Indirection
To get the value of a __normal__ property of an object, one can write also:
{{indent{{{{vValue = getProperty(myObject, "MyProperty"[, i])}}}
To set its value:
{{indent{{{{setProperty(myObject, "MyProperty", vValue[, i])}}}
!!!Introspection
Finally it is possible to get the value of ALL normal properties of a pseudo-object with the //Properties// function as in next example:
//{{{
Dim ofForm As Object, i As Integer, oProperty As Object
Set ofForm = AllForms("myForm")
For i = 0 To Properties(ofForm).Count
Set oProperty = Properties(ofForm, i)
Print oProperty.pName & " = " & oProperty.Value,
Next i
Print
//}}}
!Methods
In this context only the methods performing another action than //Get// ting or //Set// ting a property are considered.
!!!Method names
The names of the methods are identical to their equivalent in //~MSAccess//.
However
*when the name is a ''reserved word'' in ~OOo/~LibO Basic the name is preceded by a "m" (like in method). E.g. //mClose// replaces //Close//
*the semantics of the property might differ more or less
*the arguments might be different in number or in possible values
Read the documentation about each individual method for more info.
!!!Syntax
To execute a method always call the method with the concerned pseudo-object as first argument. Other arguments start at the 2nd position.
Example:
//{{{
Dim ofForm As Object
Set ofForm = AllForms("myForm")
Move(ofForm, 100, 200) ' To compare with VBA => ofForm.Move(100, 200)
//}}}
{{firstletter{
@@color:#930;T@@
}}}he //Quit// [[action|Actions]] quits //~OpenOffice/~LibreOffice Base//. You can select one of several options for saving a database object before quitting.
!!!Syntax
{{{Quit(}}}//{{{Option}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description |
|{{{Option}}} | Yes | acQuitPrompt, acQuitSaveAll, acQuitSaveNone |//acQuitPrompt// Displays a dialog box that asks whether you want really to quit or not.<br />//acQuitSaveAll// (default) Saves all objects without displaying a dialog box.<br />//acQuitSaveNone// Quits without saving any objects. |
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acQuitPrompt = 0
Global Const acQuitSaveAll = 1
Global Const acQuitSaveNone = 2
//}}}
!!!Remarks
The Quit method has the same effect as clicking Exit on the File menu in the //~OpenOffice/~LibreOffice Base// window.
!!!Error messages
!!!See also
!!!Example
Display next message box: ''Do you really want to quit the application ? Changed data will be saved.''
If Yes pressed, the application will close.
//{{{
Quit(acQuitPrompt)
//}}}
{{firstletter{
@@color:#930;A@@
}}} //~RadioButton// [[control|Control]] enables the user to choose among one of several options. Radio buttons with the same functionality are given the same name (Name property). Normally, they are given a group box.
!!!Specific properties of radio buttons
| !Property | !Read only | !Description or UNO object |
|[[Name]] | Y |Specifies the exact name of all the radio buttons sharing the same [[OptionGroup]]. |
|[[OptionValue]] | Y |Specifies the value that is stored in the database when the radio button is selected and the record saved. |
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the ~SubForm has the given property. |
!!!Remarks
The ~RadioButton control has no //Value// property.
To identify the selected radio button, use the [[getOptionGroup]] function and the [[Value]] property of the returned [[OptionGroup]] pseudo-object.
!!!See also
[[getOptionGroup]]
[[OptionGroup]]
!!!Example
<<tiddler "Optiongroup example">>
You can use the //~RecordSource// property to specify The source of the data displayed in a form.
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
|[[SubForm]] |The subform of an open form |
!!!Syntax
//form//{{{.RecordSource}}}
{{{getRecordSource(}}}//form//{{{)}}}
{{{setRecordSource(}}}//form//{{{,}}}//value//{{{)}}}
//subform//{{{.RecordSource}}}
{{{getRecordSource(}}}//subform//{{{)}}}
{{{setRecordSource(}}}//subform//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{String}}}
!!!Remarks
The //~RecordSource// property is a string expression consisting of either
*a table name
*a query name
*a SQL statement including the SELECT verb
However to modify the ~RecordSource property, use __only a SQL statement__. When the ~RecordSource property value is changed, the //form// or //subform// is reloaded automatically.
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[ControlSource]]
[[Requery]]
!!!Example
<<tiddler "RecordSource example">>
Set new data source on open form
//{{{
Dim ofForm As Object, sSQL As String
ofForm = Forms("myForm")
sSQL = "SELECT * FROM [EMPLOYEE] WHERE " _
& "[EMPLOYEE].[NAME] LIKE '*MICKEY*' Or [EMPLOYEE].[NAME] LIKE '*WINNIE*'"
setRecordSource(ofForm, sSQL)
//}}}
The //Refresh// method immediately updates the records in the underlying record source for a specified form to reflect changes made to the data by you or other users in a multiuser environment.
!!!Applies to ...
| !Object | !Description |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice Base// database form. |
|[[SubForm]] |A subset of the [[Controls|Control]] present in a Form. |
!!!Syntax
{{{Refresh(}}}//form//{{{)}}}
{{{Refresh(}}}//subform//{{{)}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[RecordSource]]
[[Requery]]
!!!Example
<<tiddler "Refresh example">>
Refresh the data in the current record of a form
//{{{
Dim ofForm As Object
Set ofForm = Forms("myForm")
Refresh(ofForm)
//}}}
| !Release | !Date | !Description |
| 0.7.1 | 04/2012 |Correction of URL of online help. Callale from Help menu in the Basic IDE. |
| 0.7.0 | 04/2012 |Bugs fixing in the [[SelectObject]] action (abort when help file open).<br />Extension of the scope of the [[SelectObject]] action.<br />Introduction of the [[RunCommand]] action. Documentation updated. |
| 0.6.0 | 04/2012 |New actions [[SelectObject]], [[Minimize]], [[Maximize]] and [[MoveSize]]<br />"~Access2Base Help" menu command in IDE opens Online help on [[www.access2base.com|http://www.access2base.com]]. |
| 0.5.1 | 03/2012 |"Out of array range" error message added for collections (i.o. "Invalid parameter"). |
| 0.5.0 | 03/2012 |First public release. |
The //Requery// method updates the data underlying a specified control that's on the active form by requerying the source of data for the control.
!!!Applies to ...
| !Object | !Description |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice Base// database form. |
|[[SubForm]] |A subset of the [[Controls|Control]] present in a Form. |
|[[ComboBox]] |A combobox control. |
|[[ListBox]] |A listbox control. |
!!!Syntax
{{{Requery(}}}//form//{{{)}}}
{{{Requery(}}}//subform//{{{)}}}
{{{Requery(}}}//combobox//{{{)}}}
{{{Requery(}}}//listbox//{{{)}}}
!!!Remarks
If the targetted object is a Form or a ~SubForm the //Requery// method resets the current record to the first available in the record set.
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[RecordSource]]
[[Refresh]]
[[RowSource]]
!!!Example
<<tiddler "Requery example">>
Reload the content of a combo box after a database change
//{{{
Dim ofForm As Object, ocCombo As Object
Set ofForm = Forms("myForm")
Set ocCombo = Controls(ofForm, "myComboBox")
Requery(ocCombo)
//}}}
The //Required// property specifies whether a control must contain a value when the record is edited.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |~CheckBox<br />[[ComboBox]]<br />~CurrencyField<br />~DateField<br />~FormattedField<br />~ImageControl<br />[[ListBox]]<br />~NumericField<br />~PatternField<br />[[RadioButton]]<br />~TextField<br />~TimeField | All |A control on an open form or within a [[GridControl]] of one of the listed types |
!!!Syntax
//control//{{{.Required}}}
{{{getRequired(}}}//control//{{{)}}}
{{{setRequired(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property 'Required' not applicable in this context |
!!!Example
<<tiddler "Required example">>
Force value in field to avoid error on Null value when saving record (e.g. in When Loading form event)
{{{
Dim ocControl As Object
Set ocControl = Controls("myForm", "myFormattedField")
setRequired(ocControl, True)
}}}
You can use the //~RowSource// property (along with the [[RowSourceType]] property) to tell ~OpenOffice/~LibreOffice Base how to provide data to a list box or to a combo box.
!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[ComboBox]]<br />[[ListBox]] | [[ComboBox]]<br />[[ListBox]] |A combo- or listbox on an open form or in a [[GridControl]]|
!!!Syntax
//control//{{{.RowSource}}}
{{{getRowSource(}}}//control//{{{)}}}
{{{setRowSource(}}}//control, value//{{{)}}}
!!!Returned values / Arguments
{{{String}}}
!!!Remarks
The //value// argument must contain, depending on the value of the [[RowSourceType]] property, the exact name of a table or a query, or a correct SQL SELECT statement.
When the //~RowSource// property is changed the content of the combo- or listbox is refreshed.
!!!Error messages
|Argument nr.X is invalid |
|Property '~RowSource' not applicable in this context |
|Value '...' is invalid for property '~RowSource' |
!!!See also
[[ItemData]]
[[ListCount]]
[[ListIndex]]
[[MultiSelect]]
[[Requery]]
[[RowSourceType]]
[[Selected]]
!!!Example
<<tiddler "RowSource example">>
Modify the content of a combo and a listbox
Select first item in the combobox
Select all tems in the listbox
//{{{
Dim ocCombo As Object, ocList As Object
Set ocCombo = getObject("Forms!myForm!myComboBox")
setRowSourceType(ocCombo, com.sun.star.form.ListSourceType.SQL)
setRowSource(ocCombo, "SELECT [SHORTNAME] FROM COMPANIES WHERE [SHORTNAME]<>'' ORDER BY [SHORTNAME]")
setListIndex(ocCombo, 0)
Set ocList = getObject("Forms!myForm!myListBox")
setRowSourceType(ocList, com.sun.star.form.ListSourceType.VALUELIST)
setRowSource(ocList, "First;Second;Third")
setSelected(ocList, Array(True, True, True))
//}}}
You can use the //~RowSourceType// property (along with the [[RowSource]] property) to tell ~OpenOffice/~LibreOffice Base how to provide data to a list box or to a combo box.
!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[ComboBox]]<br />[[ListBox]] | [[ComboBox]]<br />[[ListBox]] |A combo- or listbox on an open form or in a [[GridControl]]|
!!!Syntax
//control//{{{.RowSourceType}}}
{{{getRowSourceType(}}}//control//{{{)}}}
{{{setRowSourceType(}}}//control, value//{{{)}}}
!!!Returned values / Arguments
{{{Integer}}}
!!!Remarks
The //value// argument must contain, depending on the value of the [[RowSource]] property, one of next symbolic values:
|com.sun.star.form.~ListSourceType.VALUELIST |
|com.sun.star.form.~ListSourceType.TABLE |
|com.sun.star.form.~ListSourceType.QUERY |
|com.sun.star.form.~ListSourceType.SQL |
|com.sun.star.form.~ListSourceType.SQLPASSTHROUGH |
|com.sun.star.form.~ListSourceType.TABLEFIELDS |
See the [[OpenOffice documentation|http://api.openoffice.org/docs/common/ref/com/sun/star/form/component/DatabaseListBox.html#ListSourceType]] for more details.
When the //~RowSourceType// property is changed the content of the combo- or listbox is ''NOT'' refreshed.
!!!Error messages
|Argument nr.X is invalid |
|Property '~RowSourceType' not applicable in this context |
|Value '...' is invalid for property '~RowSourceType' |
!!!See also
[[ItemData]]
[[ListCount]]
[[ListIndex]]
[[MultiSelect]]
[[Requery]]
[[RowSource]]
[[Selected]]
!!!Example
<<tiddler "RowSource example">>
The absence of Macro Recorder in ~OOo/~LibO Base and the lack of documentation makes the use of the numerous commands available in the software very difficult. The current help page tries to compensate partially this handicap.
The //~RunCommand// [[action|Actions]] executes the command given as argument.
Combined with the [[SelectObject]] action it enhances significantly the automation capabilities of applications using the //~Access2Base// API.
!!!Syntax
{{{RunCommand(}}}//{{{Command}}}//{{{)}}}
| !Argument | !Optional | !Type |!Description | !Returned Value |
| Command | No | String<br />Integer,Long |If numeric the Command is selected by using the VBA denomination. If the Type is a String, the ~OOo/~LibO command-name is expected | Always returns True |
!!!Commands List
| !~OOo/~LibO Command | !VBA Equivalent | !Context(s) |!Short description |
|"About" |acCmdAboutMicrosoftAccess | Any |About ~OpenOffice.org/~LibreOffice |
|~|acCmdAboutOpenOffice | Any |About ~OpenOffice.org/~LibreOffice |
|~|acCmdAboutLibreOffice | Any |About ~OpenOffice.org/~LibreOffice |
|"~ActiveHelp" || Any |Extended Tips |
|"~AddDirect" || Any |New |
|"~AddField" || acForm (Design mode) |Add Field |
|"~AutoControlFocus" || acForm (Design mode) |Automatic Control Focus |
|"~AutoFilter" || acTable |~AutoFilter |
|"~AutoPilotAddressDataSource" || Any |~AutoPilot: Address Data Source |
|"~BasicBreak" || Any |Interrupt Macro |
|"~BasicIDEAppear" |acCmdVisualBasicEditor | Any |Edit Macros |
|"~BasicStop" || acBasicIDE |Stop Macro |
|"~BringToFront" |acCmdBringToFront | Any |Bring to Front |
|"~CheckBox" || acForm (Design mode) |Check Box |
|"~ChooseMacro" || acBasicIDE |Select Macro |
|"~CloseDoc" |acCmdClose | Any |Close |
|"~CloseWin" || Any |Close Window |
|"~ConfigureDialog" |acCmdToolbarsCustomize | Any |Customize |
|"~ControlProperties" || Controls |Control |
|"~ConvertToButton" |acCmdChangeToCommandButton | Controls |Replace with Button |
|"~ConvertToCheckBox" |acCmdChangeToCheckBox | Controls |Replace with Check Box |
|"~ConvertToCombo" |acCmdChangeToComboBox | Controls |Replace with Combo Box |
|"~ConvertToCurrency" || Controls |Replace with Currency Field |
|"~ConvertToDate" || Controls |Replace with Date Field |
|"~ConvertToEdit" |acCmdChangeToTextBox | Controls |Replace with Text Box |
|"~ConvertToFileControl" || Controls |Replace with File Selection |
|"~ConvertToFixed" |acCmdChangeToLabel | Controls |Replace with Label Field |
|"~ConvertToFormatted" || Controls |Replace with Formatted Field |
|"~ConvertToGroup" || Controls |Replace with Group Box |
|"~ConvertToImageBtn" || Controls |Replace with Image Button |
|"~ConvertToImageControl" |acCmdChangeToImage | Controls |Replace with Image Control |
|"~ConvertToList" |acCmdChangeToListBox | Controls |Replace with List Box |
|"~ConvertToNavigationBar" || Controls |Replace with Navigation Bar |
|"~ConvertToNumeric" || Controls |Replace with Numerical Field |
|"~ConvertToPattern" || Controls |Replace with Pattern Field |
|"~ConvertToRadio" |acCmdChangeToOptionButton | Controls |Replace with Radio Button |
|"~ConvertToScrollBar" || Controls |Replace with Scrollbar |
|"~ConvertToSpinButton" || Controls |Replace with Spin Button |
|"~ConvertToTime" || Controls |Replace with Time Field |
|"Copy" |acCmdCopy | Any |Copy |
|"~CurrencyField" || acForm (Design mode) |Currency Field |
|"Cut" |acCmdCut | Any |Cut |
|"~DateField" || acForm (Design mode) |Date Field |
|"~DBAddRelation" |acCmdCreateRelationship | acDiagram |New Relation ... |
|"~DBConvertToView" || acDatabaseWindow (Queries) |Create as View |
|"~DBDelete" |acCmdDelete | acDatabaseWindow |Delete |
|"~DBDirectSQL" || acDatabaseWindow |SQL ... |
|"~DBDSAdvancedSettings" || acDatabaseWindow |Advanced Settings ... |
|"~DBDSConnectionType" || acDatabaseWindow |Connection Type ... |
|"~DBDSProperties" |acCmdDatabaseProperties | acDatabaseWindow |Properties ... |
|"~DBEdit" || acDatabaseWindow |Edit ... |
|"~DBEditSqlView" |acCmdSQLView | acDatabaseWindow (Queries) |Edit in SQL View ... |
|"~DBFormDelete" |acCmdRemove | acDatabaseWindow (Forms) |Delete |
|"~DBFormEdit" |acCmdDesignView | acDatabaseWindow (Forms) |Edit ... |
|"~DBFormOpen" |acCmdFormView | acDatabaseWindow (Forms) |Open Database Object ... |
|"~DBFormRename" || acDatabaseWindow (Forms) |Rename ... |
|"~DBNewForm" |acCmdNewObjectForm | acDatabaseWindow (Forms) |Form ... |
|"~DBNewFormAutoPilot" || acDatabaseWindow (Forms) |Form Wizard ... |
|"~DBNewQuery" || acDatabaseWindow (Queries) |Query (Design View) ... |
|"~DBNewQueryAutoPilot" || acDatabaseWindow (Queries) |Query Wizard ... |
|"~DBNewQuerySql" || acDatabaseWindow (Queries) |Query (SQL View) ... |
|"~DBNewReport" || acDatabaseWindow (Reports) |Report ... |
|"~DBNewReportAutoPilot" || acDatabaseWindow (Reports) |Report Wizard ... |
|"~DBNewTable" |acCmdNewObjectTable | acDatabaseWindow (Tables) |Table Design ... |
|"~DBNewTableAutoPilot" || acDatabaseWindow (Tables) |Table Wizard ... |
|"~DBNewView" |acCmdNewObjectView | acDatabaseWindow (Tables) |View Design ... |
|"~DBNewViewSQL" || acDatabaseWindow (Tables) |View (Simple) ... |
|"~DBOpen" |acCmdOpenDatabase | acDatabaseWindow |Open Database Object ... |
|"~DBQueryDelete" |acCmdRemove | acDatabaseWindow (Queries) |Delete |
|"~DBQueryEdit" |acCmdDesignView | acDatabaseWindow (Queries) |Edit ... |
|"~DBQueryOpen" |acCmdNewObjectQuery | acDatabaseWindow (Queries) |Open Database Object ... |
|"~DBQueryRename" || acDatabaseWindow (Queries) |Rename ... |
|"~DBRefreshTables" || acDatabaseWindow |Refresh Tables |
|"~DBRelationDesign" |acCmdShowAllRelationships | acDatabaseWindow |Relationships ... |
|"~DBRename" || acDatabaseWindow |Rename ... |
|"~DBReportDelete" |acCmdRemove | acDatabaseWindow (Reports) |Delete |
|"~DBReportEdit" |acCmdDesignView | acDatabaseWindow (Reports) |Edit ... |
|"~DBReportOpen" |acCmdNewObjectReport | acDatabaseWindow (Reports) |Open Database Object ... |
|"~DBReportRename" || acDatabaseWindow (Reports) |Rename ... |
|"~DBSelectAll" |acCmdSelectAll | acDatabaseWindow |Select All |
|"~DBShowDocInfoPreview" || acDatabaseWindow |Document Information |
|"~DBShowDocPreview" || acDatabaseWindow |Document |
|"~DBTableDelete" |acCmdRemoveTable | acDatabaseWindow (Tables) |Delete |
|"~DBTableEdit" |acCmdDesignView | acDatabaseWindow (Tables) |Edit ... |
|"~DBTableFilter" || acDatabaseWindow (Tables) |Table Filter ... |
|"~DBTableOpen" |acCmdOpenTable | acDatabaseWindow (Tables) |Open Database Object ... |
|"~DBTableRename" |acCmdRename | acDatabaseWindow (Tables) |Rename ... |
|"~DBUserAdmin" || acDatabaseWindow |User Administration ... |
|"~DBViewForms" || acDatabaseWindow |Forms |
|"~DBViewQueries" || acDatabaseWindow |Queries |
|"~DBViewReports" || acDatabaseWindow |Reports |
|"~DBViewTables" || acDatabaseWindow |Tables |
|"Delete" |acCmdDelete | Any |Delete Contents |
|"~DeleteRecord" |acCmdDeleteRecord | acForm |Delete Record |
|"~DesignerDialog" || acForm (Design mode) |Styles and Formatting |
|"Edit" || acForm (Design mode) |Text Box |
|"~FirstRecord" || acForm |First Record |
|"~FontDialog" || acForm (Design mode) |Character |
|"~FontHeight" || acForm (Design mode) |Font Size |
|"~FormattedField" || acForm (Design mode) |Formatted Field |
|"~FormFilter" || acForm |~Form-Based Filters |
|"~FormFiltered" |acCmdApplyFilterSort | acForm |Apply Filter |
|"~FormFilterExecute" || acForm |Apply ~Form-Based Filter |
|"~FormFilterExit" || acForm |Close |
|"~FormFilterNavigator" || acForm |Filter Navigation |
|"~FormProperties" || acForm (Design mode) |Form |
|"~FullScreen" || acForm |Full Screen |
|"Gallery" || acForm |Gallery |
|"Grid" || acForm (Design mode) |Table Control |
|"~GridUse" |acCmdSnapToGrid | acForm (Design mode) |Snap to Grid |
|"~GridVisible" |acCmdViewGrid | acForm (Design mode) |Display Grid |
|"~GroupBox" || acForm (Design mode) |Group Box |
|"~HelpIndex" || Any |~OpenOffice.org Help |
|"~HelpSupport" || Any |Support |
|"~HyperlinkDialog" |acCmdInsertHyperlink | acForm (Design mode) |Hyperlink |
|"Imagebutton" || acForm (Design mode) |Image Button |
|"~ImageControl" || acForm (Design mode) |Image Control |
|"Label" || acForm (Design mode) |Label Field |
|"~LastRecord" |acCmdMaximumRecords | acForm |Last Record |
|"~ListBox" || acForm (Design mode) |List Box |
|"~MacroDialog" || Any |~OpenOffice.org Basic |
|"~MacroOrganizer" || Any |~OpenOffice.org Basic Macro Organizer |
|"~MoreControls" || acForm (Design mode) |More Controls |
|"~NavigationBar" || acForm (Design mode) |Navigation Bar |
|"Navigator" |acCmdObjectBrowser | acForm (Design mode) |Navigator |
|"~NewDoc" || Any |New Document From Template |
|"~NewRecord" || acForm |New Record |
|"~NextRecord" || acForm |Next Record |
|"~NumericField" || acForm (Design mode) |Numerical Field |
|"Open" || Any |Open |
|"~OptionsTreeDialog" || Any |Options |
|"Organizer" || Any |Organize |
|"~ParagraphDialog" || acForm (Design mode) |Paragraph |
|"Paste" |acCmdPaste | Any |Paste |
|"~PasteSpecial" |acCmdPasteSpecial | acForm (Design mode) |Paste Special ... |
|"~PatternField" || acForm (Design mode) |Pattern Field |
|"~PrevRecord" || acForm |Previous Record |
|"Print" |acCmdPrint | acForm, acReport (normal and design modes) |Print |
|"~PrintDefault" || acForm, acReport (normal and design modes) |Print File Directly |
|"~PrinterSetup" || acForm, acReport (normal and design modes) |Printer Settings |
|"~PrintPreview" |acCmdPrintPreview | acForm, acReport (normal and design modes) |Page Preview |
|"Pushbutton" || acForm (Design mode) |Push Button |
|"Quit" || acDatabaseWindow |Exit |
|"~RadioButton" || acForm (Design mode) |Option Button |
|"~RecSave" |acCmdSaveRecord | acForm |Save Record |
|"~RecSearch" |acCmdFind | acForm |Find Record |
|"~RecUndo" |acCmdUndo | acForm |Undo: Data entry |
|"Refresh" |acCmdRefresh | acForm, acTable, acQuery |Refresh |
|"Reload" || Any |Reload |
|"~RemoveFilterSort" |acCmdRemoveFilterSort | acForm |Remove Filter/Sort |
|"~RunMacro" |acCmdRunMacro | Any |Run Macro |
|"Save" |acCmdSave | Any |Save |
|"~SaveAll" || Any |Save All |
|"~SaveAs" |acCmdSaveAs | Any |Save As |
|"~SaveBasicAs" || acBasicIDE |Save BASIC |
|"~ScriptOrganizer" || Any |Organize Macros |
|"~ScrollBar" || acForm (Design mode) |Scrollbar |
|"~SearchDialog" |acCmdFind | acForm |Find & Replace |
|"~SelectAll" |acCmdSelectAll | Any |Select All |
|~|acCmdSelectAllRecords | Any |Select All |
|"~SendToBack" |acCmdSendToBack | Any |Send to Back |
|"~ShowFmExplorer" || acForm (Design mode) |Form Navigator |
|"~SortDown" |acCmdSortDescending | acForm, acTable, acQuery |Sort Descending |
|"Sortup" |acCmdSortAscending | acForm, acTable, acQuery |Sort Ascending |
|"~SpinButton" || acForm (Design mode) |Spin Button |
|"~StatusBarVisible" || Any |Status Bar |
|"~SwitchControlDesignMode" || acForm (Design mode) |Design Mode On/Off |
|"~TabDialog" |acCmdTabOrder | acForm (Design mode) |Activation Order |
|"~UseWizards" || acForm (Design mode) |Wizards On/Off |
|"~VersionDialog" || acForm (Design mode) |Versions |
|"~ViewDataSourceBrowser" || acForm |Data Sources |
|"~ViewFormAsGrid" |acCmdDatasheetView | acForm |Data source as Table |
|"Zoom" |acCmdZoomSelection | |Zoom |
The (VBA) symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acDiagram = 8
Global Const acForm = 2
Global Const acQuery = 1
Global Const acReport = 3
Global Const acTable = 0
Global Const acBasicIDE = 101
Global Const acDatabaseWindow = 102
//}}}
and, or ...
//{{{
Global Const acCmdAboutMicrosoftAccess = 35
Global Const acCmdAboutOpenOffice = 35
Global Const acCmdAboutLibreOffice = 35
Global Const acCmdVisualBasicEditor = 525
Global Const acCmdBringToFront = 52
Global Const acCmdClose = 58
Global Const acCmdToolbarsCustomize = 165
Global Const acCmdChangeToCommandButton = 501
Global Const acCmdChangeToCheckBox = 231
Global Const acCmdChangeToComboBox = 230
Global Const acCmdChangeToTextBox = 227
Global Const acCmdChangeToLabel = 228
Global Const acCmdChangeToImage = 234
Global Const acCmdChangeToListBox = 229
Global Const acCmdChangeToOptionButton = 233
Global Const acCmdCopy = 190
Global Const acCmdCut = 189
Global Const acCmdCreateRelationship = 150
Global Const acCmdDelete = 337
Global Const acCmdDatabaseProperties = 256
Global Const acCmdSQLView = 184
Global Const acCmdRemove = 366
Global Const acCmdDesignView = 183
Global Const acCmdFormView = 281
Global Const acCmdNewObjectForm = 136
Global Const acCmdNewObjectTable = 134
Global Const acCmdNewObjectView = 350
Global Const acCmdOpenDatabase = 25
Global Const acCmdRemove = 366
Global Const acCmdDesignView = 183
Global Const acCmdNewObjectQuery = 135
Global Const acCmdShowAllRelationships = 149
Global Const acCmdRemove = 366
Global Const acCmdDesignView = 183
Global Const acCmdNewObjectReport = 137
Global Const acCmdSelectAll = 333
Global Const acCmdRemoveTable = 84
Global Const acCmdDesignView = 183
Global Const acCmdOpenTable = 221
Global Const acCmdRename = 143
Global Const acCmdDelete = 337
Global Const acCmdDeleteRecord = 223
Global Const acCmdApplyFilterSort = 93
Global Const acCmdSnapToGrid = 62
Global Const acCmdViewGrid = 63
Global Const acCmdInsertHyperlink = 259
Global Const acCmdMaximumRecords = 508
Global Const acCmdObjectBrowser = 200
Global Const acCmdPaste = 191
Global Const acCmdPasteSpecial = 64
Global Const acCmdPrint = 340
Global Const acCmdPrintPreview = 54
Global Const acCmdSaveRecord = 97
Global Const acCmdFind = 30
Global Const acCmdUndo = 292
Global Const acCmdRefresh = 18
Global Const acCmdRemoveFilterSort = 144
Global Const acCmdRunMacro = 31
Global Const acCmdSave = 20
Global Const acCmdSaveAs = 21
Global Const acCmdFind = 30
Global Const acCmdSelectAll = 333
Global Const acCmdSelectAllRecords = 109
Global Const acCmdSendToBack = 53
Global Const acCmdSortDescending = 164
Global Const acCmdSortAscending = 163
Global Const acCmdTabOrder = 41
Global Const acCmdDatasheetView = 282
Global Const acCmdZoomSelection = 371
//}}}
!!!Remarks
*//RunCommand// always returns //True//. If the argument does not exist, of if the request is not appropriate to the context, the action ignores the request.
*The Command argument, when of type String, is not case-sensitive.
*Above list of commands is not exhaustive. Other commands could succeed as well. However if the command to execute is not in the above list the argument MUST correspond exactly (... be properly cased as should ...) with the argument expected by a {{{executeDispatch()}}} UNO statement.
*The ~OOo/~LibO command and its VBA equivalent are //presumed// to be equivalent. The ~RunCommand action always executes a ~OOo/~LibO command. There is no emulation of the VBA command.
*The //Context// column indicates one or more contexts in which the command has been tested and executed successfully. This does mean that other contexts could also allow a successful execution of the same command. When the context is __//Any//__ this only means that the command is likely to succeed in any context.
*The //~RunCommand// action is very often preceded by a [[SelectObject]] action to activate the correct context.
*Most commands open a dialog box. Today the ~OOo/~LibO documentation does not contain any indication about arguments that could bypass the dialog. The only ways to discover them are either to scan the software sources (what I did not do !) or to record the macro. But //~OOo/~LibO Base// has no //Macro Recorder// (although Forms have ...!?) implemented.
!!!Error messages
|Arguments are missing or are not initialized |
!!!See also
[[SelectObject]]
!!!Examples
<<tiddler "RunCommand example">>
Open a form, and display it with its data source grid ...
//{{{
OpenForm("myForm")
RunCommand(acCmdDatasheetView) ' or RunCommand("ViewFormAsGrid")
//}}}
Next Sub linked to the "When loading" event ALWAYS opens a form with ts datagrid ...
//{{{
Sub DisplayGrid(oEvent As Object)
RunCommand(acCmdDatasheetView)
End Sub
//}}}
To open a form in design mode with automatic display of Form properties ...
//{{{
OpenForm("myForm", acDesign)
RunCommand("FormProperties")
//}}}
To enter an SQL statement at any time, execute next code ...
//{{{
SelectObject(acDatabaseWindow)
RunCommand("DBDirectSQL")
//}}}
{{firstletter{
@@color:#930;T@@
}}}he //~RunSQL// [[action|Actions]] executes the SQL statement given as argument. The statement must execute an action. Examples of such statements are: INSERT INTO, DELETE, SELECT...INTO, UPDATE, CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE INDEX, or DROP INDEX.
!!!Syntax
{{{RunSQL(SQL)}}}
| !Argument | !Optional | !Type |!Description |
|{{{SQL}}} | No | String |Specifies the statement to execute |
The action returns False if the execution of the SQL statement failed.
!!!Remarks
RDBMS system commands can also be executed with {{{RunSQL}}}.
E.g.
//{{{
SHUTDOWN COMPACT
//}}}
which is valid for an HSQLDB database, will close the database connection and compact the data contained in the database. See the respective RDBMS manuals for more details.
!!!Error messages
|Arguments are missing or are not initialized |
|SQL Error, SQL statement = '...' |
!!!See also
!!!Example
<<tiddler "Runsql example">>
Create a new database table
//{{{
If RunSQL( _
"CREATE TABLE customer (" _
& "First_Name char(50)" _
& ", Last_Name char(50)" _
& ", Address char(50)" _
& ", City char(50)" _
& ", Country char(25)" _
& ", Birth_Date date" _
& ")") Then MsgBox "Customer table has been created !"
//}}}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- Google Analytics Start -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30099972-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- Google Analytics End -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>SITE_TITLE: TIDDLER_TITLE</title>
<meta name="description" content="SITE_SUBTITLE">
<meta name="keywords" content="OpenOffice, LibreOffice, MSAccess, Microsoft Access, API, VBA, Basic, It's about migrating people not data">
<script language="JavaScript" type="text/javascript">
location.href = 'TIDDLER_URL';
</script>
<base href="TIDDLER_URL">
</head>
<body>
<noscript>
<a href="TIDDLER_URL">TIDDLER_TITLE</a>
</noscript>
TIDDLER_CONTENT
</body>
</html>
/***
|''Name:''|SEOTiddlyWikiPlugin|
|''Version:''|last update: 2007-02-14|
|''Source''|http://www.superphysique.net#%5B%5BSEO%20TiddlyWiki%20Plugin%5D%5D ([[del.icio.us|http://del.icio.us/post?url=http://www.superphysique.net#%5B%5BSEO%20TiddlyWiki%20Plugin%5D%5D]])|
|''Author:''|Fabrice Proudhon|
|''Type:''|Plugin|
!Purpose
I wrote this Search Engine Optimization plugin to improve ~TiddlyWiki website's ranking on Google, Yahoo, etc. Basically, it does two things:
1) For each tiddler and each tag of this one, it creates a html file with the tiddler's content and named according to the tiddler's title. The html file is written in a way that it can be easily crawled by a search engine (short and with html format, not ~TiddlyWiki's format), but if it is opened (which will be the case if it appears in the results of a search engine), it redirects to the ~TiddlyWiki with the corresponding tiddler opened.
2) It creates the sitemap.xml and urllist.txt files for Google and Yahoo which included generated html files.
!How to install
1) Create two tiddlers like these one (same name and content):
[[SEOTiddlyWikiPlugin]] [[SEOTiddlyWikiConfig]]
NB: double-clic on each tiddler to get edit mode and copy-paste their content.
2) Fill in shadow tiddlers SiteUrl, SiteTitle and SiteSubtitle.
3) Edit this tiddler and see the code behind the following link to understand how to launch the process, once the plugin installed, add to a tiddler:
{{{<html><a href="javascript:generateSEOFiles();">Generate SEO files</a></html>}}}
which will generate a link as such: <html><a href="javascript:generateSEOFiles();">Generate SEO files</a></html>.
4) See http://www.google.com/webmasters/sitemaps/ to register your sitemap.xml file.
Tips
1) Feel free to modify html template [[SEOTiddlyWikiConfig]].
2) Use tag //excludeSearch// to disallow the export of a tiddler.
Limitation
If you remove a tiddler after an export, you have to manually remove the corresponding html file.
!Report a bug
<<email fabrice.proudhon at yahoo dot com>>
!Copyright
<html><!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by/2.5/"><img alt="Creative Commons License" style="border-width: 0" src="http://i.creativecommons.org/l/by/2.5/88x31.png"/></a><br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5 License</a>.<!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<Work rdf:about="">
<license rdf:resource="http://creativecommons.org/licenses/by/2.5/" />
</Work>
<License rdf:about="http://creativecommons.org/licenses/by/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/></License></rdf:RDF> --></html>
!Code
***/
//{{{
function generateSEOFiles()
{
// last update: 2007-02-14 by Fabrice Proudhon
// http://www.superphysique.net#%5B%5BSEO%20TiddlyWiki%20Plugin%5D%5D
var originalPath = document.location.toString();
if(originalPath.substr(0,5) != "file:")
{
alert(config.messages.notFileUrlError);
if(store.tiddlerExists(config.messages.saveInstructions))
story.displayTiddler(null,config.messages.saveInstructions);
return;
}
var y = [];
var g = [];
var localPath = getLocalPath(originalPath);
var c = store.getTiddlerText("SEOTiddlyWikiConfig");
var su = store.getTiddlerText("SiteUrl");
var st = wikifyPlain("SiteTitle");
var sbt = wikifyPlain("SiteSubtitle");
var htmlPath = localPath.substr(0,localPath.lastIndexOf("\\"));
var tiddlers = store.getTiddlers("modified","excludeLists");
g.push('<url><loc>' + su.htmlEncode() + '</loc></url>');
y.push(su.htmlEncode());
for (var t=0; t<tiddlers.length; t++) {
var content = c;
var filename = tiddlers[t].title.htmlEncode();
filename = filename.toLowerCase();
filename = filename.replace(/ |\/|@/gi, '-');
filename = filename.replace(/(-)\1+/gi, '$1');
content = content.replace(/SITE_TITLE/gi, st.htmlEncode());
content = content.replace(/SITE_SUBTITLE/gi, sbt.htmlEncode());
content = content.replace(/TIDDLER_TITLE/gi, tiddlers[t].title.htmlEncode());
content = content.replace(/TIDDLER_URL/gi, su.htmlEncode() + '#' + String.encodeTiddlyLink(tiddlers[t].title));
content = content.replace(/TIDDLER_KEYWORDS/gi, tiddlers[t].tags.join(',').htmlEncode());
content = content.replace(/TIDDLER_CONTENT/gi, wikifyStatic(tiddlers[t].text,null,tiddlers[t]).htmlEncode());
content = content.replace(/</gi, '<');
content = content.replace(/>/gi, '>');
content = content.replace(/"/gi, '"');
var d = tiddlers[t].modified.getFullYear() + '-';
if (tiddlers[t].modified.getMonth() + 1 < 10) d = d + '0';
d = d + (tiddlers[t].modified.getMonth() + 1) + '-';
if (tiddlers[t].modified.getDate() < 10) d = d + '0';
d = d + tiddlers[t].modified.getDate();
for (var ta=0; ta<tiddlers[t].tags.length; ta++) {
var tag = tiddlers[t].tags[ta].toLowerCase();
g.push('<url><loc>' + su.htmlEncode() + escape(tag) + '/' + escape(filename) + '.htm' + '</loc><lastmod>' + d + '</lastmod></url>');
y.push(su.htmlEncode() + escape(tag) + '/' + escape(filename) + '.htm');
saveFile(htmlPath + '\\' + tag + '\\' + filename + '.htm', convertUnicodeToUTF8(content));
}
}
saveFile(htmlPath + '\\urllist.txt', convertUnicodeToUTF8(y.join('\n')));
saveFile(htmlPath + '\\sitemap.xml', '<?xml version="1.0" encoding="utf-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84">\n' + convertUnicodeToUTF8(g.join('\n')) + '</urlset>');
displayMessage('SEO files created', '');
}
//}}}
The //~SelectObject// [[action|Actions]] moves the focus to the specified window.
!!!Syntax
{{{SelectObject(}}}//{{{ObjectType, ObjectName, InDatabaseWindow}}}//{{{)}}}
| !Argument | !Optional | !Type<br />or<br />Symbol |!Description | !Returned Value |
|{{{ObjectType}}} | No | acTable<br />acQuery<br />acForm<br />acReport<br />acDiagram (Relationships)<br />acBasicIDE<br />acDatabaseWindow |The type of object to set the focus on. | True if sucess |
|{{{ObjectName}}} | Yes | String |The name of the object to set the focus on. This argument is NOT case-sensitive.<br />The argument is mandatory when the //~ObjectType// argument is one of next values: //acTable//, //acQuery//, //acForm// or //acReport//. |~|
|{{{InDatabaseWindow}}} | Yes | Boolean |Specifies if the object has to be selected in the Database Window.<br />Must be FALSE. |~|
The symbolic constants can be included in your code by copying and pasting next lines:
//{{{
Global Const acDiagram = 8
Global Const acForm = 2
Global Const acQuery = 1
Global Const acReport = 3
Global Const acTable = 0
Global Const acBasicIDE = 101
Global Const acDatabaseWindow = 102
//}}}
!!!Remarks
The selected window MUST NOT be minimized or hidden. Otherwise the ~SelectObject action will ignore the request.
!!!Error messages
|Arguments are missing or are not initialized |
|Argument nr. 1 is invalid |
|Object '...' not found |
!!!See also
[[Maximize]]
[[Minimize]]
[[MoveSize]]
[[RunCommand]]
[[setFocus]]
!!!Example
<<tiddler "SelectObject example">>
Select the database window and minimize it, then set focus on an open form.
//{{{
Const acForm = 2
Const acDatabaseWindow = 102
SelectObject(acDatabaseWindow)
Minimize()
SelectObject(acForm, "myForm")
Maximize()
//}}}
The //Selected// property determines if the specified row in a combo box or list box is currently selected.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | [[ListBox]] | [[ListBox]] |A listbox on an open form or in a [[GridControl]]|
!!!Syntax
//control//{{{.Selected}}}
{{{getSelected(}}}//control//{{{)}}}
{{{setSelected(}}}//control, value//{{{)}}}
//control//{{{.Selected(}}}//index//{{{)}}}
{{{getSelected(}}}//control, index//{{{)}}}
{{{setSelected(}}}//control, value, index//{{{)}}}
!!!Returned values / Arguments
{{{Array of Booleans}}} (might be empty) if index is absent.
{{{Boolean}}} if index is present
!!!Remarks
It is better to use the [[Value]] property for non-multiselect listboxes.
The //index// argument must have a (integer or long) value between 0 and (//~ListCount// - 1)
If //index// is absent {{{getSelected}}} returns an array [0 ... //~ListCount// - 1]. If the listbox is empty the returned array is also empty.
If //index// is absent the //value// argument must be an array [0 ... //~ListCount// - 1].
!!!Error messages
|Argument nr.X is invalid |
|Property 'Selected' not applicable in this context |
|Out of array range or incorrect array size for property 'Selected'|
!!!See also
[[ItemData]]
[[ListCount]]
[[ListIndex]]
[[MultiSelect]]
[[RowSource]]
[[RowSourceType]]
[[Value]]
!!!Example
*List box
<<tiddler "ListBox example">>
The shortcut n{{firstletter{
@@color:#930;T@@
}}}ation allows to reach a [[pseudo object|Pseudo Object]] or anyone of its properties by mean of a call to one single function. The first argument of the function is a string designating unambiguously the target [[form|Form]], or [[control|Control]], or one of their properties.
!!!The shortcut notation
The //shortcut notation// binds several //components// by mean of two operators:
*The "!" (exclamation mark)<br />The component on the left of the "!" is a //parent// of the component on its right. A //parent// may be a [[collection|Collection]] or a [[pseudo object|Pseudo Object]] containing other //pseudo objects//, just like __a form__ might __contain controls__.<br />The first component must be a collection, the only allowed collection being [[Forms]].
*The "." (dot)<br />The dot separates a pseudo object on its left from one of the properties of the object on its right.
Note that the //shortcut notation// is NOT case-sensitive.
!!!Examples
*The //myForm// form:
//{{{
Forms!myForm
//}}}
*The AllowEdits property of //myForm//:
//{{{
Forms!myForm.AllowEdits
//}}}
*A control in //myForm//:
//{{{
Forms!myForm!myControl
//}}}
*The BackColor property of //myControl//:
//{{{
Forms!myForm!myControl.BackColor
//}}}
*A control in a subform:
//{{{
Forms!myForm!mySubForm.Form!mySubcontrol
//}}}
*The [[ControlTipText]] property of a control in a [[gridcontrol|GridControl]] located itself in a subform:
//{{{
Forms!myForm!mySubForm.Form!myGridControl!mySubControl.ControlTipText
//}}}
!!!Associated functions
| !Function | !Description |
|[[getObject]] |Returns a pseudo object corresponding with its argument. |
|[[getValue]] |Returns a property of the pseudo object corresponding with its argument. |
|[[setValue]] |Sets a property of the pseudo object corresponding with its arguments. |
{{indent{It's about migrating ''PEOPLE'', not data
http://www.access2base.com/
/***
|''Name:''|SpecificA2BPlugin|
|''Description:''|Forces readOnly to true or false. Useful to distribute a ReadOnly version of Access2Base help file. Set value to //true// in code below.|
!Code
***/
//{{{
readOnly = (window.location.protocol == "file:") ? true : config.options.chkHttpReadOnly;
//}}}
/***
|''Description:''|Modify tiddler tooltip for anonymisation.<br>Standard value: "%0 - %1, %2".|
!Code
***/
//{{{
merge(config.messages,{
tiddlerLinkTooltip: "%0 - Click to open",
});
//}}}
/***
|''Description''|Modify the header of the List macro.|
!Code
***/
//{{{
config.macros.list.all.prompt = "All topics in alphabetical order";
//}}}
/***
!~TiddlyWiki Classic Color Scheme
Designed by Jeremy Ruston
http://tiddlystyles.com/#theme:Classic
To use this color scheme copy the ~ClassicTiddlyWiki contents into a tiddler and name it 'StyleSheet' also grab the ~ClassicTemplate and copy its contents into a tiddler named 'PageTemplate'.
!Colors Used
*@@bgcolor(#630):color(#fff): #630@@
*@@bgcolor(#930): #930@@
*@@bgcolor(#996633): #963@@
*@@bgcolor(#c90): #c90@@
*@@bgcolor(#cf6): #cf6@@
*@@bgcolor(#cc9): #cc9@@
*@@bgcolor(#ba9): #ba9@@
*@@bgcolor(#996): #996@@
*@@bgcolor(#300):color(#fff): #300@@
*@@bgcolor(#000000):color(#fff): #000@@
*@@bgcolor(#666): #666@@
*@@bgcolor(#888): #888@@
*@@bgcolor(#aaa): #aaa@@
*@@bgcolor(#ddd): #ddd@@
*@@bgcolor(#eee): #eee@@
*@@bgcolor(#ffffff): #fff@@
*@@bgcolor(#f00): #f00@@
*@@bgcolor(#ff3): #ff3@@
!Generic Rules /%==============================================%/
***/
/*{{{*/
body {
background: #fff;
color: #000;
}
a{
color: #963;
}
a:hover{
background: #963;
color: #fff;
}
a img{
border: 0;
}
h1,h2,h3,h4,h5 {
background: #cc9;
}
/*}}}*/
/***
!Header /%==================================================%/
***/
/*{{{*/
.header{
background: #300;
}
.titleLine {
color: #fff;
padding: 5em 0em 1em .5em;
}
.titleLine a {
color: #cf6;
}
.titleLine a:hover {
background: transparent;
}
/*}}}*/
/***
!Main Menu /%=================================================%/
***/
/*{{{*/
#mainMenu .button {
color: #930;
}
#mainMenu .button:hover {
color: #cf6;
background: #930;
}
#mainMenu li{
list-style: none;
}
/*}}}*/
/***
!Sidebar options /%=================================================%/
~TiddlyLinks and buttons are treated identically in the sidebar and slider panel
***/
/*{{{*/
#sidebar {
background: #c90;
right: 0;
}
#sidebarOptions a{
color: #930;
border: 0;
margin: 0;
padding: .25em .5em;
}
#sidebarOptions a:hover {
color: #cf6;
background: #930;
}
#sidebarOptions a:active {
color: #930;
background: #cf6;
}
#sidebarOptions .sliderPanel {
background: #eea;
margin: 0;
}
#sidebarOptions .sliderPanel a {
color: #930;
}
#sidebarOptions .sliderPanel a:hover {
color: #cf6;
background: #930;
}
#sidebarOptions .sliderPanel a:active {
color: #930;
background: #cf6;
}
/*}}}*/
/***
!Sidebar tabs /%=================================================%/
***/
/*{{{*/
.tabSelected,.tabContents {
background: #eea;
border: 0;
}
.tabUnselected {
background: #c90;
}
#sidebarTabs {
background: #c90;
}
#sidebarTabs .tabSelected{
color: #cf6;
background: #963;
}
#sidebarTabs .tabUnselected {
color: #cf6;
background: #930;
}
#sidebarTabs .tabContents{
background: #963;
}
#sidebarTabs .txtMoreTab .tabSelected,
#sidebarTabs .txtMoreTab .tabSelected:hover{
background: #930;
color: #cf6;
}
#sidebarTabs .txtMoreTab .tabUnselected,
#sidebarTabs .txtMoreTab .tabUnselected:hover{
background: #300;
color: #cf6;
}
#sidebarTabs .txtMoreTab .tabContents {
background: #930;
}
#sidebarTabs .tabContents a {
color: #cf6;
border: 0;
}
#sidebarTabs .button.highlight,
#sidebarTabs .tabContents a:hover {
background: #cf6;
color: #300;
}
/*}}}*/
/***
!Message Area /%=================================================%/
***/
/*{{{*/
#messageArea {
background: #930;
color: #fff;
}
#messageArea a:link, #messageArea a:visited {
color: #c90;
}
#messageArea a:hover {
color: #963;
background: transparent;
}
#messageArea a:active {
color: #fff;
}
/*}}}*/
/***
!Popup /%=================================================%/
***/
/*{{{*/
.popup {
background: #eea;
border: 1px solid #930;
}
.popup hr {
color: #963;
background: #963;
border-bottom: 1px;
}
.popup li.disabled {
color: #ba9;
}
.popup li a, .popup li a:visited {
color: #300;
}
.popup li a:hover {
background: #930;
color: #eea;
}
/*}}}*/
/***
!Tiddler Display /%=================================================%/
***/
/*{{{*/
.tiddler .button {
color: #930;
}
.tiddler .button:hover {
color: #cf6;
background: #930;
}
.tiddler .button:active {
color: #fff;
background: #c90;
}
.shadow .title {
color: #888;
}
.title {
color: #422;
}
.subtitle {
color: #866;
}
.toolbar {
color: #aaa;
}
.toolbar a,
.toolbar a:hover{
border: 0;
}
.tagging, .tagged {
border: 1px solid #fff;
background-color: #ffc;
}
.selected .tagging, .selected .tagged {
border: 1px solid #aa6;
background-color: #ffc;
}
.tagging .listTitle, .tagged .listTitle {
color: #999999;
}
.footer {
color: #ddd;
}
.selected .footer {
color: #888;
}
.sparkline {
background: #eea;
border: 0;
}
.sparktick {
background: #930;
}
.errorButton {
color: #ff0;
background: #f00;
}
.zoomer {
color: #963;
border: 1px solid #963;
}
/*}}}*/
/***
''The viewer is where the tiddler content is displayed'' /%------------------------------------------------%/
***/
/*{{{*/
.viewer .button {
background: #c90;
color: #300;
border-right: 1px solid #300;
border-bottom: 1px solid #300;
}
.viewer .button:hover {
background: #eea;
color: #c90;
}
.viewer .imageLink{
background: transparent;
}
.viewer blockquote {
border-left: 3px solid #666;
}
.viewer table {
border: 2px solid #303030;
}
.viewer th, thead td {
background: #996;
border: 1px solid #606060;
color: #fff;
}
.viewer td, .viewer tr {
border: 1px solid #606060;
}
.viewer pre {
border: 1px solid #963;
background: #eea;
}
.viewer code {
color: #630;
}
.viewer hr {
border: 0;
border-top: dashed 1px #606060;
color: #666;
}
.highlight, .marked {
background: #ff3;
}
/*}}}*/
/***
''The editor replaces the viewer in the tiddler'' /%------------------------------------------------%/
***/
/*{{{*/
.editor input {
border: 1px solid #000;
}
.editor textarea {
border: 1px solid #000;
width: 100%;
}
.editorFooter {
color: #aaa;
}
.editorFooter a {
color: #930;
}
.editorFooter a:hover {
color: #cf6;
background: #930;
}
.editorFooter a:active {
color: #fff;
background: #c90;
}
/*}}}*/
/***
!Specific addition for ~Access2Base /%=================================================%/
***/
/*{{{*/
@media print {#mainMenu {display: none ! important;}}
@media print {#topMenu {display: none ! important;}}
@media print {#sidebar {display: none ! important;}}
@media print {#messageArea {display: none ! important;}}
@media print {#toolbar {display: none ! important;}}
@media print {.header {display: none ! important;}}
@media print {.tiddler .subtitle {display: none ! important;}}
@media print {.tiddler .toolbar {display; none ! important; }}
@media print {.tiddler .tagging {display; none ! important; }}
@media print {.tiddler .tagged {display; none ! important; }}
#mainMenu {
position:absolute;
left:0;
width:13em;
text-align:right;
line-height:1.6em;
padding:1.5em 0.5em 0.5em 0.5em;
font-size:1.1em;
}
#displayArea {
margin:1em 17em 0 16em;
}
.titleLine {
color: #fff;
padding: 3em 0em 1em .5em;
}
.firstletter{ float:left; width:0.75em; font-size:400%; font-family:times,arial; line-height:60%; }
.tiddler .subtitle { display:none; }
/*}}}*/
/*~StyleSheetShortcuts*/
{{firstletter{
@@color:#930;A@@
}}} //~SubForm// [[Pseudo-Object|Pseudo Object]] represents a subset of the controls of an open //form//. The open form is called the "parent form" or "master". ~SubForms are used mainly to access more than one table (or query) from a //form//. Each additional table requires its own //subform//.
!!!Properties returning a subform pseudo-object
| !Property | !Object |!Description |
|[[Form|Form (subform)]] | [[Control]] |A //subform// is a //Control// like another. The //Form// property of a control of type //~SubForm// will return a //~SubForm// [[Pseudo-Object|Pseudo Object]]. |
!!!Properties
| !Property | !Type | !Read only | !Description or UNO object |
|[[Name]] || Y |Specifies the exact name of the subform control. |
|[[AllowAdditions]] |||Specifies whether a user can add a record when using the subform. |
|[[AllowDeletions]] |||Specifies whether a user can delete a record when using the subform. |
|[[AllowEdits]] |||Specifies whether a user can modify a record when using the subform. |
|[[Filter]] |||Specifies a subset of records to be displayed. |
|[[FilterOn]] |||Specifies if the Filter has to be applied. |
|[[LinkChildFields]]<br />[[LinkMasterFields]] || Y |Specify how records in a form are linked to records in a subform. |
|[[RecordSource]] |||Specifies the source of the data. |
|~ParentComponent | UNO | Y |com.sun.star.text.~TextDocument |
|~DatabaseForm | UNO | Y |com.sun.star.form.component.~DataForm<br />com.sun.star.sdb.~ResultSet |
!!!Methods
| !Method | !Argument(s) | !Return | !Description |
|[[hasProperty]] | property | Boolean |Return True if the ~SubForm has the given property. |
|[[Requery]] || Boolean |True if data reloaded in ~SubForm |
!!!Remarks
Each //~SubForm// [[Pseudo-Object|Pseudo Object]] has a Controls [[collection|Collection]], which contains all controls on the subform. You can refer to a specific control on a subform by referring to the [[Controls]] collection.
!!!Example
<<tiddler "Subform example">>
The types of control can be recognized thru the use either of the //~SubType// or the [[ControlType]] properties. The ~SubType property has no correspondent with ~MSAccess but has the advantage to identify all control types.
See the correspondence table below.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | All | All |A control on an open form |
!!!Syntax
//control//{{{.SubType}}}
{{{getSubType(}}}//control//{{{)}}}
!!!Returned values
{{{String}}}
Table of values:
<<tiddler "ControlTypesList">>
!!!Remarks
The ~SubType property is read-only.
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[ControlType]]
!!!Example
<<tiddler "ControlType example">>
List all the controls of a subform
//{{{
Dim ocSubform As Object, osfSubform As Object, i As Integer, iCount As Integer
Set ocSubform = Controls("myForm", "mySubform")
Set osfSubform = ocSubform.Form
iCount = Controls(osfSubform).Count
For i = 0 To iCount - 1
Print getName(Controls(osfSubform, i)),
Next i
Print
//}}}
The //~TabIndex// property specifies a control's place in the tab order on a form.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~FixedText<br />~GroupBox<br />~HiddenControl<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.TabIndex}}}
{{{getTabIndex(}}}//control//{{{)}}}
{{{setTabIndex(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~TabIndex' not applicable in this context |
!!!See also
[[TabStop]]
!!!Example
<<tiddler "TabIndex example">>
List all controls in ~TabIndex ascending sequence. Only initialized ~TabIndexes are included.
//{{{
Dim ofForm As Object, ocControl As Object, i As Integer, iCount As Integer
Dim sNames() As String
Set ofForm = Forms("myForm")
iCount = Controls(ofForm).Count
ReDim sNames(0 To iCount - 1)
For i = 0 To iCount - 1
Set ocControl = Controls(ofForm, i)
If hasProperty(ocControl, "TABINDEX") Then
If ocControl.TabIndex > 0 And ocControl.TabIndex < iCount Then sNames(ocControl.TabIndex) = ocControl.pName
End If
Next i
For i = 0 To iCount - 1
If sNames(i) <> "" Then Print sNames(i),
Next i
Print
//}}}
Reset Tab sequence to automatic
//{{{
For i = 0 To iCount - 1
If sNames(i) <> "" Then
Set ocControl = Controls(ofForm, sNames(i))
SetTabIndex(ocControl, -1)
End If
Next i
//}}}
The //~TabStop// property specifies if the focus can be set on a control by using .the TAB key.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~FixedText<br />~GroupBox<br />~HiddenControl<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//control//{{{.TabStop}}}
{{{getTabStop(}}}//control//{{{)}}}
{{{setTabStop(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Property '~TabStop' not applicable in this context |
!!!See also
[[TabIndex]]
!!!Example
<<tiddler "TabStop example">>
List all controls having ~TabStop = True
//{{{
Dim ofForm As Object, ocControl As Object, i As Integer
Set ofForm = Forms("myForm")
For i = 0 To Controls(ofForm).Count - 1
Set ocControl = Controls(ofForm, i)
If hasProperty(ocControl, "TABSTOP") Then
If ocControl.TabStop Then _Print getName(ocControl)
End If
Next i
_Print
//}}}
Forbid access to myControl via Tab key
//{{{
Set ocControl = Controls(ofForm, "myControl")
setTabStop(ocControl, False)
//}}}
The //Tag// property stores extra information about a [[Control]].
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |All except<br />--~SubForm<br />-- | All |A control on an open form |
!!!Syntax
//control//{{{.Tag}}}
{{{getTag(}}}//control//{{{)}}}
{{{setTag(}}}//control//, //value//{{{)}}}
!!!Returned values / Arguments
{{{String}}}
!!!Remarks
You can use this property to assign an identification string to a control without affecting any of its other property settings or causing other side effects. The //Tag// property is useful when you need to check the identity of a control that is passed as a variable to a procedure.
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[OpenArgs]]
!!!Example
<<tiddler "Tag example">>
Associate a tag value to a control
//{{{
Dim ofForm As Object, ocControl As Object, sTag As String
sTag = "This is an informative message"
Set ofForm = Forms("myForm")
Set ocControl = Controls(ofForm, "myControl")
setTag(ocControl, sTag)
//}}}
Usage: f.i. displaying the tag content in a info textbox when the control receives the focus
/***
|''Name:''|TagsTreePlugin|
|''Description:''|Displays tags hierachy as a tree of tagged tiddlers.<br>Can be used to create dynamic outline navigation.|
|''Version:''|1.0.1|
|''Date:''|Jan 04,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0|
!Demo
On the plugin [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] :
*Try to tag some <<newTiddler>> with a tag displayed in the menu and edit MainMenu.
*Look at some tags like [[Plugins]] or [[menu]].
!Installation
#import the plugin,
#save and reload,
#optionally, edit TagsTreeStyleSheet.
! Usage
{{{<<tagsTree>>}}} macro accepts the following //optional// parameters.
|!#|!parameter|!description|!by default|
|1|{{{root}}}|Uses {{{root}}} tag as tree root|- In a //tiddler// content or template : uses the tiddler as root tag.<br>- In the //page// content or template (by ex MainMenu) : displays all untagged tags.|
|2|{{{excludeTag}}}|Excludes all such tagged tiddlers from the tree|Uses default excludeLists tag|
|3|{{{level}}}|Expands nodes until level {{{level}}}.<br>Value {{{0}}} hides expand/collapse buttons.|Nodes are collapsed on first level|
|4|{{{depth}}}|Hierachy depth|6 levels depth (H1 to H6 header styles)|
|5|{{{sortField}}}|Alternate sort field. By example : "index".|Sorts tags and tiddlers alphabetically (on their title)|
|6|{{{labelField}}}|Alertnate label field. By example : "label".|Displays tiddler's title|
!Useful addons
*[[FieldsEditorPlugin]] : //create//, //edit//, //view// and //delete// commands in toolbar <<toolbar fields>>.
*[[TaggerPlugin]] : Provides a drop down listing current tiddler tags, and allowing toggling of tags.
!Advanced Users
You can change the global defaults for TagsTreePlugin, like default {{{level}}} value or level styles, by editing or overriding the first config.macros.tagsTree attributes below.
!Code
***/
//{{{
config.macros.tagsTree = {
expand : "+",
collapse : "–",
depth : 6,
level : 1,
sortField : "",
labelField : "",
styles : ["h1","h2","h3","h4","h5","h6"],
trees : {}
}
config.macros.tagsTree.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
var root = params[0] ? params[0] : (tiddler ? tiddler.title : null);
var excludeTag = params[1] ? params[1] : "excludeTagsTree";
var level = params[2] ? params[2] : config.macros.tagsTree.level;
var depth = params[3] ? params[3] : config.macros.tagsTree.depth;
var sortField = params[4] ? params[4] : config.macros.tagsTree.sortField;
var labelField = params[5] ? params[5] : config.macros.tagsTree.labelField;
var showButtons = (level>0);
var id = config.macros.tagsTree.getId(place);
if (config.macros.tagsTree.trees[id]==undefined) config.macros.tagsTree.trees[id]={};
config.macros.tagsTree.createSubTree(place,id,root,excludeTag,[],level>0 ? level : 1,depth, sortField, labelField,showButtons);
}
config.macros.tagsTree.createSubTree = function(place, id, root, excludeTag, ancestors, level, depth, sortField, labelField,showButtons){
var childNodes = root ? this.getChildNodes(root, ancestors) : this.getRootTags(excludeTag);
var isOpen = (level>0) || (!showButtons);
if (root && this.trees[id][root]!=undefined) isOpen = this.trees[id][root];
if (root && ancestors.length) {
var t = store.getTiddler(root);
if (childNodes.length && depth>0) {
var wrapper = createTiddlyElement(place , this.styles[Math.min(Math.max(ancestors.length,1),6)-1],null,"branch");
if (showButtons) {
b = createTiddlyButton(wrapper, isOpen ? config.macros.tagsTree.collapse : config.macros.tagsTree.expand, null, config.macros.tagsTree.onClick);
b.setAttribute("treeId",id);
b.setAttribute("tiddler",root);
}
createTiddlyText(createTiddlyLink(wrapper, root),t&&labelField ? t.fields[labelField] ? t.fields[labelField] : root : root);
}
else
createTiddlyText(createTiddlyLink(place, root,false,"leaf"),t&&labelField ? t.fields[labelField] ? t.fields[labelField] : root : root);
}
if (childNodes.length && depth) {
var d = createTiddlyElement(place,"div",null,"subtree");
d.style.display= isOpen ? "block" : "none";
if (sortField)
childNodes.sort(function(a, b){
var fa=a.fields[sortField];
var fb=b.fields[sortField];
return (fa==undefined && fb==undefined) ? a.title < b.title ? -1 : a.title > b.title ? 1 : 0 : (fa==undefined && fb!=undefined) ? 1 :(fa!=undefined && fb==undefined) ? -1 : fa < fb ? -1 : fa > fb ? 1 : 0;
})
for (var cpt=0; cpt<childNodes.length; cpt++)
this.createSubTree(d, id, childNodes[cpt].title, excludeTag, ancestors.concat(root), level-1, depth-1, sortField, labelField, showButtons);
}
}
config.macros.tagsTree.onClick = function(e){
var id = this.getAttribute("treeId");
var tiddler = this.getAttribute("tiddler");
var n = this.parentNode.nextSibling;
var isOpen = n.style.display != "none";
if(config.options.chkAnimate && anim && typeof Slider == "function")
anim.startAnimating(new Slider(n,!isOpen,null,"none"));
else
n.style.display = isOpen ? "none" : "block";
this.firstChild.nodeValue = isOpen ? config.macros.tagsTree.expand : config.macros.tagsTree.collapse;
config.macros.tagsTree.trees[id][tiddler]=!isOpen;
return false;
}
config.macros.tagsTree.getChildNodes = function(root ,ancestors){
var childs = store.getTaggedTiddlers(root);
var result = new Array();
for (var cpt=0; cpt<childs.length; cpt++)
if (childs[cpt].title!=root && ancestors.indexOf(childs[cpt].title)==-1) result.push(childs[cpt]);
return result;
}
config.macros.tagsTree.getRootTags = function(excludeTag){
var tags = store.getTags(excludeTag);
tags.sort(function(a,b) {return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : (a[0].toLowerCase() == b[0].toLowerCase() ? 0 : +1);});
var result = new Array();
for (var cpt=0; cpt<tags.length; cpt++) {
var t = store.getTiddler(tags[cpt][0]);
if (!t || t.tags.length==0) result.push(t ? t : {title:tags[cpt][0],fields:{}});
}
return result;
}
config.macros.tagsTree.getId = function(element){
while (!element.id && element.parentNode) element=element.parentNode;
return element.id ? element.id : "<html>";
}
config.shadowTiddlers.TagsTreeStyleSheet = "/*{{{*/\n";
config.shadowTiddlers.TagsTreeStyleSheet +=".leaf, .subtree {display:block; margin-left : 0.5em}\n";
config.shadowTiddlers.TagsTreeStyleSheet +=".subtree {margin-bottom:0.5em}\n";
config.shadowTiddlers.TagsTreeStyleSheet +="#mainMenu {text-align:left}\n";
config.shadowTiddlers.TagsTreeStyleSheet +=".branch .button {border:1px solid #DDD; color:#AAA;font-size:9px;padding:0 2px;margin-right:0.3em;vertical-align:middle;text-align:center;}\n";
config.shadowTiddlers.TagsTreeStyleSheet +="/*}}}*/";
store.addNotification("TagsTreeStyleSheet", refreshStyles);
config.shadowTiddlers.MainMenu="<<tagsTree>>"
config.shadowTiddlers.PageTemplate = config.shadowTiddlers.PageTemplate.replace(/id='mainMenu' refresh='content' /,"id='mainMenu' refresh='content' force='true' ")
//}}}
/*{{{*/
.leaf, .subtree {
display:block;
margin-left : 0.5em
}
.subtree {
margin-bottom:0.5em
}
#mainMenu {
text-align:left
}
.branch {
border:1px solid #DDD;
color:#AAA;
font-size:12px;
padding:0 2px;
margin-right:0.3em;
vertical-align:middle;
text-align:left;
}
.button {
border:1px solid #DDD;
font-size:12px;
padding:0 2px;
margin-right:0.7em;
vertical-align:
middle;
text-align:center;
}
/*}}}*/
The //Text// property specifies the text displayed in a Control. This property is __read-only__.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |[[ComboBox]]<br />~DateField<br />~FileControl<br />~FormattedField<br />~PatternField<br />~TextField<br />~TimeField |[[ComboBox]]<br />~DateField<br />~FormattedField<br />~PatternField<br />~TextField<br />~TimeField |A control on an open form |
!!!Syntax
//control//{{{.pText}}}
{{{getText(}}}//control//{{{)}}}
!!!Returned values
{{{String}}}
!!!Remarks
To set the text contained in a Control, use the [[Value]] property.
!!!Error messages
|Argument nr.X is invalid |
|Property '~TextAlign' not applicable in this context |
!!!See also
[[Value]]
!!!Example
<<tiddler "Text example">>
Display the text as displayed in a DATEFIELD control (depends on the regional settings)
//{{{
Dim ofForm As Object, ocDate As Object, vValue As Variant, sText As String
Set ofForm = Forms("myForm")
ocDate = Controls(ofForm, "myDateField")
sText = ocDate.pText
vValue = ocDate.Value
MsgBox sText & " - " & Day(vValue) & "/" & Month(vValue) & "/" & Year(vValue)
//}}}
The //~TextAlign// property specifies the text alignment in a Control.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |~CheckBox<br />[[ComboBox]]<br />~CommandButton<br />~CurrencyField<br />~DateField<br />~FixedText<br />~FormattedField<br />[[ListBox]]<br />~NumericField<br />~PatternField<br />[[RadioButton]]<br />~TextField<br />~TimeField | All |A control on an open form |
!!!Syntax
//control//{{{.TextAlign}}}
{{{getTextAlign(}}}//control//{{{)}}}
{{{setTextAlign(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Integer}}} or {{{Long}}}
!!!Remarks
The allowed values for ~TextAlign are:
>0: Left
>1: Center
>2: Right
!!!Error messages
|Argument nr.X is invalid |
|Property '~TextAlign' not applicable in this context |
!!!See also
[[FontBold]]
[[FontItalic]]
[[FontName]]
[[FontSize]]
[[FontUnderline]]
[[FontWeight]]
[[ForeColor]]
!!!Example
<<tiddler "Font example">>
Next people have indirectly contributed to the birth of the ~Access2Base API:
*''Bernard Marcelly'' because I would have abandoned the project without the existence of ~XRayTool, the inspector of API objects, See [[here|http://bernard.marcelly.perso.sfr.fr/index2.html]].
*''Jeremy Ruston'' who developed the remarkable personal wiki which served as template for the documentation of ~Access2Base. See [[TiddlyWiki, a reusable non-linear personal web notebook|http://www.tiddlywiki.com/]].
*''Andrew Pitonyak'' I found a number of promising examples in [[Base Macro programming|http://www.pitonyak.org/database/AndrewBase.pdf]].
*''Roberto Benitez'', his [[BaseTools|http://extensions.services.openoffice.org/en/project/BaseTools]] extension was a first step in the direction of the implementation of an ~MSAccess-like API. A few snippets in my code are inspired by his work.
*''DACM'', after a few database corruptions I was very happy to discover his posts on the ~OpenOffice forum (see a.o. [[Avoid data loss by avoiding "Embedded databases"|http://user.services.openoffice.org/en/forum/viewtopic.php?p=162653#p162653]]) !!
Many thanks to all of them.
/***
|''Name:''|TiddlersBarPlugin|
|''Description:''|A bar to switch between tiddlers through tabs (like browser tabs bar).|
|''Version:''|1.2.5|
|''Date:''|Jan 18,2008|
|''Source:''|http://visualtw.ouvaton.org/VisualTW.html|
|''Author:''|Pascal Collin|
|''License:''|[[BSD open source license|License]]|
|''~CoreVersion:''|2.1.0|
|''Browser:''|Firefox 2.0; InternetExplorer 6.0, others|
!Demos
On [[homepage|http://visualtw.ouvaton.org/VisualTW.html]], open several tiddlers to use the tabs bar.
!Installation
#import this tiddler from [[homepage|http://visualtw.ouvaton.org/VisualTW.html]] (tagged as systemConfig)
#save and reload
#''if you're using a custom [[PageTemplate]]'', add {{{<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>}}} before {{{<div id='tiddlerDisplay'></div>}}}
#optionally, adjust StyleSheetTiddlersBar
!Tips
*Doubleclick on the tiddlers bar (where there is no tab) create a new tiddler.
*Tabs include a button to close {{{x}}} or save {{{!}}} their tiddler.
*By default, click on the current tab close all others tiddlers.
!Configuration options
<<option chkDisableTabsBar>> Disable the tabs bar (to print, by example).
<<option chkHideTabsBarWhenSingleTab >> Automatically hide the tabs bar when only one tiddler is displayed.
<<option txtSelectedTiddlerTabButton>> ''selected'' tab command button.
<<option txtPreviousTabKey>> previous tab access key.
<<option txtNextTabKey>> next tab access key.
!Code
***/
//{{{
config.options.chkDisableTabsBar = config.options.chkDisableTabsBar ? config.options.chkDisableTabsBar : false;
config.options.chkHideTabsBarWhenSingleTab = config.options.chkHideTabsBarWhenSingleTab ? config.options.chkHideTabsBarWhenSingleTab : false;
config.options.txtSelectedTiddlerTabButton = config.options.txtSelectedTiddlerTabButton ? config.options.txtSelectedTiddlerTabButton : "closeOthers";
config.options.txtPreviousTabKey = config.options.txtPreviousTabKey ? config.options.txtPreviousTabKey : "";
config.options.txtNextTabKey = config.options.txtNextTabKey ? config.options.txtNextTabKey : "";
config.macros.tiddlersBar = {
tooltip : "see ",
tooltipClose : "click here to close this tab",
tooltipSave : "click here to save this tab",
promptRename : "Enter tiddler new name",
currentTiddler : "",
previousState : false,
previousKey : config.options.txtPreviousTabKey,
nextKey : config.options.txtNextTabKey,
tabsAnimationSource : null, //use document.getElementById("tiddlerDisplay") if you need animation on tab switching.
handler: function(place,macroName,params) {
var previous = null;
if (config.macros.tiddlersBar.isShown())
story.forEachTiddler(function(title,e){
if (title==config.macros.tiddlersBar.currentTiddler){
var d = createTiddlyElement(null,"span",null,"tab tabSelected");
config.macros.tiddlersBar.createActiveTabButton(d,title);
if (previous && config.macros.tiddlersBar.previousKey) previous.setAttribute("accessKey",config.macros.tiddlersBar.nextKey);
previous = "active";
}
else {
var d = createTiddlyElement(place,"span",null,"tab tabUnselected");
var btn = createTiddlyButton(d,title,config.macros.tiddlersBar.tooltip + title,config.macros.tiddlersBar.onSelectTab);
btn.setAttribute("tiddler", title);
if (previous=="active" && config.macros.tiddlersBar.nextKey) btn.setAttribute("accessKey",config.macros.tiddlersBar.previousKey);
previous=btn;
}
var isDirty =story.isDirty(title);
var c = createTiddlyButton(d,isDirty ?"!":"x",isDirty?config.macros.tiddlersBar.tooltipSave:config.macros.tiddlersBar.tooltipClose, isDirty ? config.macros.tiddlersBar.onTabSave : config.macros.tiddlersBar.onTabClose,"tabButton");
c.setAttribute("tiddler", title);
if (place.childNodes) {
place.insertBefore(document.createTextNode(" "),place.firstChild); // to allow break line here when many tiddlers are open
place.insertBefore(d,place.firstChild);
}
else place.appendChild(d);
})
},
refresh: function(place,params){
removeChildren(place);
config.macros.tiddlersBar.handler(place,"tiddlersBar",params);
if (config.macros.tiddlersBar.previousState!=config.macros.tiddlersBar.isShown()) {
story.refreshAllTiddlers();
if (config.macros.tiddlersBar.previousState) story.forEachTiddler(function(t,e){e.style.display="";});
config.macros.tiddlersBar.previousState = !config.macros.tiddlersBar.previousState;
}
},
isShown : function(){
if (config.options.chkDisableTabsBar) return false;
if (!config.options.chkHideTabsBarWhenSingleTab) return true;
var cpt=0;
story.forEachTiddler(function(){cpt++});
return (cpt>1);
},
selectNextTab : function(){ //used when the current tab is closed (to select another tab)
var previous="";
story.forEachTiddler(function(title){
if (!config.macros.tiddlersBar.currentTiddler) {
story.displayTiddler(null,title);
return;
}
if (title==config.macros.tiddlersBar.currentTiddler) {
if (previous) {
story.displayTiddler(null,previous);
return;
}
else config.macros.tiddlersBar.currentTiddler=""; // so next tab will be selected
}
else previous=title;
});
},
onSelectTab : function(e){
var t = this.getAttribute("tiddler");
if (t) story.displayTiddler(null,t);
return false;
},
onTabClose : function(e){
var t = this.getAttribute("tiddler");
if (t) {
if(story.hasChanges(t) && !readOnly) {
if(!confirm(config.commands.cancelTiddler.warning.format([t])))
return false;
}
story.closeTiddler(t);
}
return false;
},
onTabSave : function(e) {
var t = this.getAttribute("tiddler");
if (!e) e=window.event;
if (t) config.commands.saveTiddler.handler(e,null,t);
return false;
},
onSelectedTabButtonClick : function(event,src,title) {
var t = this.getAttribute("tiddler");
if (!event) event=window.event;
if (t && config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton])
config.commands[config.options.txtSelectedTiddlerTabButton].handler(event, src, t);
return false;
},
onTiddlersBarAction: function(event) {
var source = event.target ? event.target.id : event.srcElement.id; // FF uses target and IE uses srcElement;
if (source=="tiddlersBar") story.displayTiddler(null,'New Tiddler',DEFAULT_EDIT_TEMPLATE,false,null,null);
},
createActiveTabButton : function(place,title) {
if (config.options.txtSelectedTiddlerTabButton && config.commands[config.options.txtSelectedTiddlerTabButton]) {
var btn = createTiddlyButton(place, title, config.commands[config.options.txtSelectedTiddlerTabButton].tooltip ,config.macros.tiddlersBar.onSelectedTabButtonClick);
btn.setAttribute("tiddler", title);
}
else
createTiddlyText(place,title);
}
}
story.coreCloseTiddler = story.coreCloseTiddler? story.coreCloseTiddler : story.closeTiddler;
story.coreDisplayTiddler = story.coreDisplayTiddler ? story.coreDisplayTiddler : story.displayTiddler;
story.closeTiddler = function(title,animate,unused) {
if (title==config.macros.tiddlersBar.currentTiddler)
config.macros.tiddlersBar.selectNextTab();
story.coreCloseTiddler(title,false,unused); //disable animation to get it closed before calling tiddlersBar.refresh
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
story.displayTiddler = function(srcElement,tiddler,template,animate,unused,customFields,toggle){
story.coreDisplayTiddler(config.macros.tiddlersBar.tabsAnimationSource,tiddler,template,animate,unused,customFields,toggle);
var title = (tiddler instanceof Tiddler)? tiddler.title : tiddler;
if (config.macros.tiddlersBar.isShown()) {
story.forEachTiddler(function(t,e){
if (t!=title) e.style.display="none";
else e.style.display="";
})
config.macros.tiddlersBar.currentTiddler=title;
}
var e=document.getElementById("tiddlersBar");
if (e) config.macros.tiddlersBar.refresh(e,null);
}
var coreRefreshPageTemplate = coreRefreshPageTemplate ? coreRefreshPageTemplate : refreshPageTemplate;
refreshPageTemplate = function(title) {
coreRefreshPageTemplate(title);
if (config.macros.tiddlersBar) config.macros.tiddlersBar.refresh(document.getElementById("tiddlersBar"));
}
ensureVisible=function (e) {return 0} //disable bottom scrolling (not useful now)
config.shadowTiddlers.StyleSheetTiddlersBar = "/*{{{*/\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .button {border:0}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar .tab {white-space:nowrap}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += "#tiddlersBar {padding : 1em 0.5em 2px 0.5em}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tabUnselected .tabButton, .tabSelected .tabButton {padding : 0 2px 0 2px; margin: 0 0 0 4px;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar += ".tiddler, .tabContents {border:1px [[ColorPalette::TertiaryPale]] solid;}\n";
config.shadowTiddlers.StyleSheetTiddlersBar +="/*}}}*/";
store.addNotification("StyleSheetTiddlersBar", refreshStyles);
config.refreshers.none = function(){return true;}
config.shadowTiddlers.PageTemplate=config.shadowTiddlers.PageTemplate.replace(/<div id='tiddlerDisplay'><\/div>/m,"<div id='tiddlersBar' refresh='none' ondblclick='config.macros.tiddlersBar.onTiddlersBarAction(event)'></div>\n<div id='tiddlerDisplay'></div>");
//}}}
/***
|Name|ToggleSideBarMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#ToggleSideBarMacro|
|Version|1.0|
|Requires|~TW2.x|
!Description:
Provides a button for toggling visibility of the SideBar. You can choose whether the SideBar should initially be hidden or displayed.
!Demo
<<toggleSideBar "Toggle Sidebar">>
!Usage:
{{{<<toggleSideBar>>}}} <<toggleSideBar>>
additional options:
{{{<<toggleSideBar label tooltip show/hide>>}}} where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is shown at first or not.
(default is to show the sidebar)
You can add it to your tiddler toolbar, your MainMenu, or where you like really.
If you are using a horizontal MainMenu and want the button to be right aligned, put the following in your StyleSheet:
{{{ .HideSideBarButton {float:right;} }}}
!History
*23-07-06: version 1.0: completely rewritten, now works with custom stylesheets too, and easier to customize start behaviour.
*20-07-06: version 0.11
*27-04-06: version 0.1: working.
!Code
***/
//{{{
config.macros.toggleSideBar={};
config.macros.toggleSideBar.settings={
styleHide : "#sidebar { display: none;}\n"+"#contentWrapper #displayArea { margin-right: 1em;}\n"+"",
styleShow : " ",
arrow1: "«",
arrow2: "»"
};
config.macros.toggleSideBar.handler=function (place,macroName,params,wikifier,paramString,tiddler)
{
var tooltip= params[1]||'toggle sidebar';
var mode = (params[2] && params[2]=="hide")? "hide":"show";
var arrow = (mode == "hide")? this.settings.arrow1:this.settings.arrow2;
var label= (params[0]&¶ms[0]!='.')?params[0]+" "+arrow:arrow;
var theBtn = createTiddlyButton(place,label,tooltip,this.onToggleSideBar,"button HideSideBarButton");
if (mode == "hide")
{
(document.getElementById("sidebar")).setAttribute("toggle","hide");
setStylesheet(this.settings.styleHide,"ToggleSideBarStyles");
}
};
config.macros.toggleSideBar.onToggleSideBar = function(){
var sidebar = document.getElementById("sidebar");
var settings = config.macros.toggleSideBar.settings;
if (sidebar.getAttribute("toggle")=='hide')
{
setStylesheet(settings.styleShow,"ToggleSideBarStyles");
sidebar.setAttribute("toggle","show");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow1,settings.arrow2);
}
else
{
setStylesheet(settings.styleHide,"ToggleSideBarStyles");
sidebar.setAttribute("toggle","hide");
this.firstChild.data= (this.firstChild.data).replace(settings.arrow2,settings.arrow1);
}
return false;
}
setStylesheet(".HideSideBarButton .button {font-weight:bold; padding: 0 5px;}\n","ToggleSideBarButtonStyles");
//}}}
|~ViewToolbar|closeTiddler closeOthers +editTiddler > permalink references|
|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|
!!!Role
Display a dialog box for error handling settings and registered errors viewing. This routine is typically called from a button or a menu item.
[img[TraceLog Dialog.png]]
!!!Syntax
~TraceConsole has no arguments.
{{{TraceConsole()}}}
!!!User interface
| !Control | !Description |
|Clear the list |All the entries are erased from the list. |
|Set minimal trace level |All the calls for logging an event (TraceLog) having a level below the indicated level are ignored. |
|Set max number of entries |Determines the size of the circular buffer containing the logged events. When changed the existing list is always erased. |
|Dump to file |Open a File Save As ... window to save all the current entries in APPEND mode to a text file. |
!!!See also
[[Error Handler]]
[[TraceError]]
[[TraceLog]]
!!!Role
Manages errors:
- registers the error in the error logging circular buffer
- informs the end-user
- stops the program or continues
!!!Syntax
{{{TraceError(TraceLevel, ErrorCode, ErrorProcedure, ErrorLine)}}}
!!!Arguments
| !Argument | !Type | !Description |
|~TraceLevel | String |The level of the occurred event. See [[error handling generalities|Error Handler]] for more details.<br />The call to ~TraceError is __ignored__ if the given level is lower than the current minimal trace level. |
|~ErrorCode | Integer |The numeric code of the error. Normally the output of the ~OOo/~LibO Basic Err function. |
|~ErrorProcedure | String |The name of the procedure where the error occurred. |
|~ErrorLine | Integer |The line number where the error occurred. |
!!!See also
[[Error Handler]]
[[TraceConsole]]
[[TraceLog]]
!!!Example
<<tiddler "TraceError example">>
!usage
{{{[img[TraceError Msgbox.png]]}}}
[img[TraceError Msgbox.png]]
!notes
//none//
!type
image/png
!file
./TraceError Msgbox.png
!url
!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWUAAABuCAIAAABwV5WbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAHvVJREFUeF7tnQl8FEW+xyuESwRcRFhZFBa5EZBwyGW4bxIIgQBRjoCGIyGwRnfXdT2e5qM+RHkguruK7hPddYUlIIoakPVJFkWRS44YsgmZzH3kmMlJQqDev7p6unvuyWTCMOHfn/8n9FRXV1f/uurb//pXdxNBKSWKJSLmdEREJCTQq21YcmSEuLF1W7beJpK0jCT11+BvRGQkvUZJ/XXSogVpQch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/yWLOECqA3+MLY15sztSCWSy6Ymb6Rlrnu7pBCf7/bczhoM4mYxGvP4DPVqoOYR/AQ/uvgMALjHeGz8wIv7Sayyfh41S8v4W7wYlU2PT+N1nMGUIFZF60GY7f7wwbX0NXdGbNy+/Dx6linz26/sXS8DU4hZQtH1RVWkLYB/DQ/ivAngfn/18R8sJ/1UKe06S/AHV49i97wv37nRte+1tlpbmmujTkkmIF/FEAeRE2PoXycsIH7OCbVBU2Q3VVSU112ZVq65WaJrG6uuqgm6Kq5bVXyq/U2MpKLvvTWDFPyBWQeYHPa4X8YmAFUIGbXAGMd4alf3GTtyqsXnNVAHmBvEAFUAF/FWC8wPdHmuvdAM8LFQiuAsgLf8kaXN2xNFQgHBWQeUG6nYGQ553xOv7WWZv5Zk9GZtnQUAFU4JZTAAYjQ74WxyOk6z72pCezXfYV/rNBBvt6sgaVI2SGkVIA5qXCXkrzWO1d3urgZS9v1YAyPZjHvbwI63mTp6N4Tw+w5gHVsGGtS2qfwWtjYoMPboENb+qstd+oVuGt0Xrvvx+y3t19J3tei9z1NvsHDRVABVABXwr8P3d+Zk4JJn1EAAAAAElFTkSuQmCC
Trap an error:
//{{{
Function ShowError()
On Local Error Goto Error_Function
Dim i As Integer, j As Integer
i = 10
j = i / 0
REM ...
Exit_Function:
Exit Function
Error_Function:
TraceError("ERROR", Err, "ShowError", Erl)
Goto Exit_Function
End Function ' ShowError
//}}}
The execution of
>{{{ShowError()}}}
will result in the display of next message to the user:
[img[TraceError Msgbox.png]]
!!!Role
Registers in the Traces circular buffer a new entry.
!!!Syntax
{{{TraceLog(TraceLevel, Text, [MessageBox])}}}
!!!Arguments
| !Argument | !Type | !Default | !Description |
|~TraceLevel | String ||The level of the occurred event. See [[error handling generalities|Error Handler]] for more details.<br />The call to ~TraceLog is __ignored__ if the given level is lower than the current minimal trace level. |
|Text | String ||Text to be recorded. |
|~MessageBox | Boolean | True |Indicates if the Text must also be displayed to the user in a message box. |
!!!See also
[[Error Handler]]
[[TraceConsole]]
[[TraceError]]
!!!Example
<<tiddler "TraceLog example">>
!usage
{{{[img[TraceLog Dialog.png]]}}}
[img[TraceLog Dialog.png]]
!notes
//none//
!type
image/png
!file
!url
!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAqEAAAEZCAIAAAAosWuMAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAARp5JREFUeF7tnQt41NaZ9wU0Ibv7tN9u2eRpt0m6aZu2m7TZkN7SpqRp7k0gJReS0OZC0gLBhGTj7Xa/bZukLU+abkpZaEi3Xw2FdOk2JRhjsLEZCAFjg7HxfWxssMHX8f1+98zY33t0NBqNRmNGmhlpRvP38z7DoDnSkX460u+coyNpzszMjKD4m7O4dM6ceTRhxj2fTZ43R/rx0svY9/nzhA/MEzxe+pwzb96Md0bwTAtz5wpzBWHatxQP/Qd/IBBTAqyI4g8EYkhgzlQMF45Fg8CM8iRG370BSCb5/6gQXipMeYRLRb9OzRUu/QCbJnhYuEU7X0IG/4CY+AOCe0aY7Jg5+vmARZHj+d+cxeUUl64emZ/qXfCjmX/4OYtPvjbzmV/PLNwws3DLzNc2s1j0Fotv/HfI4AkQIBA7ArMUP/wEAlEhELvSiyWDgKZGaSI3rPzJnRsczMiBQaamIHFf+rxH+EalsPCEbHZBFvzcJztJ8HOfH5z/g2lKKmv+mv+coSDTX7/JH6R8HsqJ+A4CIAACIAACIHBRAqRUHjwl/85VzZvW3Lxy0ETlf3kjXA6ubIr5L3ophMeHhVsqudyZ44VvFglLm4WHz85Z2U0hrO7lQb6f98LovBenyPrCv3rnpc5Q8O/0KU/kX/jES1+apm4AnhIBAiAAAglKYM7z0wgQiB0BOi5o4VysXKA85qRMzV05Oe+5kXkrB+esGBWeHhK+I35+d4j+K01Z0SfweKKHfdKvy7qEx7tZ0BSKR1qEO6qERfUKx99fInzngj+eahee7eS+J9PzYL4PEexXWic5Vg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AABEAgigTgeDgeBEAABEAABOxJAI63536NYjUQiwIBEAABEEhQAszxV+H+eDyHBwRAAARAAARsRwCORzseBEAABEAABOxJAI63535N0G4lrDYIgAAIgEAUCcDxcDwIgAAIgAAI2JMAHG/P/RrFaiAWBQIgAAIgkKAE4Hg4HgRAAARAAATsSQCOt+d+TdAqJ1YbBEAABEAgigT8jhc+WkavkP/wQ21XpPRdtqxh/re79IZw7yACBEAABEAABEAgLgjQzfGfPyLdHy9csYe9SZ7F274v/L8xDcpLb8R0fXwLp4cGmBAG2BpYK92E3zay7QZyMbL5tG46w0AuRrZFbzHWuRV6t1pOb2DzDeRlDjED22JkFv270kguBs5jcbtiBrZF/yxGiqX+XEwqyQZ2pYFZaPP/hxn2Y2nCgg2C8Pf/j/2DAAEQAAEQAAEQsBeB/w8eNHi162DOKQAAAABJRU5ErkJggg==
!usage
{{{[img[TraceLog Msgbox.png]]}}}
[img[TraceLog Msgbox.png]]
!notes
//none//
!type
image/png
!file
./TraceLog Msgbox.png
!url
!data
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMsAAABuCAIAAAAGSHA5AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAG3tJREFUeF7tnQlcFEf2xwvxvrLG6MY10TXeZwTvA8X7AkUUlaiIJniA6GaSvbI5/omfJJvLv8Zkd7NmdzXZTSIRFWMMGjerBGO8iQIiCzLMfcAcnIJo7XtdPT09w4DAzOgwdn9+n7G6uvp11avvvKruLpwASikRbQFhlwICAiGD3mqD2YEB/MHWbTHdJpC0DCQ1t+EzIDCQ3qak5g5p0YK0IOSOzUoN7PjUhs3xiS2g2ieqwSpBxW6B9G2HulWxPahwa1JdQ1pzvVvdgrRuiXmkBnWLY6MV8NOSK9yS3KKkSkdPDncwBYSxLSAsA9R6Q1kb2e2uL9BfvIbq+zod+B4NepcGfUAn7kSFfIia+uc6xQr4ju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7IEFouEvndr0mqn5CpoQ/84n5WXG++5SNyuAf/P9OPe3Rg389T83r+ft0/WaTLjES39Jau7r9De/+8+yMkNlhcnbHvO2fX8jDJYdw7rQUqu2ory4ssJ8s8Jys9Irqq6u8LhEVS2pullys9JqLr7hbQK8bd9OmH88cfW2vyT7jfWAv830G9t+qby3PSAR5otP9bzd6/fSPhLmT+8l76XvpGs1xAMSYVIM864H7ISRHpdhsv9wpLp7vKltVH6bRQaxyFyrJMkDjfYADJHDv+NHSdL9AK7YR+21JdiuS0EZseopuQcvUI+c7DuVFF+lnkO16wxP+cRyboVT/R13nc6t35Tz0Xot1+lPwfMN9qqD/xvSZXX0kTuOcq5DbSo+RU567sYnruSRj/AfSZIHvOOB/wHtITVTythkHwAAAABJRU5ErkJggg==
~TraceLog some information
//{{{
TraceLog("WARNING", "You should be more careful !!")
//}}}
Next message will be displayed to the user if the current minimal trace level is at least "WARNING".
[img[TraceLog Msgbox.png]]
The //~TripleState// property specifies how a check box will display Null values.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] | ~CheckBox | ~CheckBox |A control on an open form or ~GridControl. |
!!!Syntax
//control//{{{.TripleState}}}
{{{getTripleState(}}}//control//{{{)}}}
{{{setTripleState(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
The ~TripleState property uses the following settings:
|True |The control will cycle through states for Yes, No, and Null values. The control appears dimmed (grayed) when its Value property is set to Null. |
|False (Default) |The control will cycle through states for Yes and No values. Null values display as if they were No values. |
!!!Error messages
|Argument nr.X is invalid |
|Property '~TripleState' not applicable in this context |
!!!Example
<<tiddler "Triplestate example">>
Identify if a checkbox accept Null values
//{{{
Dim ofForm As Object,ocControl As Object
Set ofForm = Forms("myform")
Set ocControl = Controls(ofForm, "myChkBox")
MsgBox ocControl.TripleState
//}}}
{{firstletter{
@@color:#930;T@@
}}}he reader is assumed to have already a reasonable knowledge of //~OOo/~LibO Basic// and of the //~OOo/~LibO Basic// IDE. The knowledge of the //~OpenOffice/~LibreOffice API// is not required. A basic knowledge of the //~MSAccess// object model is an advantage.
!DEFINITIONS
*[[What are pseudo objects ?|Pseudo Object]] - A necessary preamble
*[[What are collections ?|Collection]]
**Their [[Count]] property
!FORMS and CONTROLS
!!Introduction
*The [[AllForms]] collection - all forms
*The [[Forms]] collection - all active forms
*The [[Form]] pseudo object - one active form
*The [[Controls]] collection - all controls of an active form
*The [[Control]] pseudo object - one control on an active form
!!Properties
*Form properties
**[[Name]]
**[[AllowAdditions]], [[AllowDeletions]], [[AllowEdits]] - is a form updatable ?
**[[RecordSource]], [[Filter]], [[FilterOn]] - which data are queried ?
**[[IsLoaded]] - is the form active ?
**[[Height]], [[Width]], [[Visible]] - how is the form formatted ?
**[[OpenArgs]]
*Control properties
**[[Name]]
**[[ControlType]], [[SubType]] - control typology ?
**[[BackColor]], [[BorderColor]], [[BorderStyle]], [[ControlTipText]]<br />[[FontBold]], [[FontItalic]], [[FontName]], [[FontSize]], [[FontUnderline]], [[FontWeight]], [[ForeColor]]<br />[[Format]], [[TextAlign]], [[Visible]], [[TripleState]]<br />[[Cancel]], [[Caption]], [[Default]]<br /> - how is the control's look & feel ?
**[[Enabled]], [[Locked]], [[Required]] - is the control read-only ... ?
**[[DefaultValue]], [[Tag]], [[Text]], [[Value]] - what is the content of the control ?
**[[TabIndex]], [[TabStop]] - what is the tab sequence of the control ?
**[[ControlSource]] - which data is linked to the control ?
!!Methods
*[[Move]] - move and resize a form
*[[Refresh]], [[Requery]] - requery the underlying data of a form or a control
*[[setFocus]] - set the cursor somewhere
!!Special controls
!!!Subforms
*What is a [[subform|SubForm]] ?
*The [[form|Form (subform)]] property of a control
*Subform properties
**[[Name]]
**[[AllowAdditions]], [[AllowDeletions]], [[AllowEdits]] - is a subform updatable ?
**[[RecordSource]], [[Filter]], [[FilterOn]] - which data are queried ?
**[[LinkChildFields]], [[LinkMasterFields]] - how is the subform related to its parent form ?
!!!Gridcontrols
*Tabular display of data via a [[gridcontrol|GridControl]]
*Use of the [[Controls]] collection to find the columns of a gridcontrol
!!!List- and Comboboxes
*What is a [[ListBox]] ? What is a [[ComboBox]] ?
*List- and combobox properties
**[[ItemData]], [[RowSource]], [[RowSourceType]] - which data in the box and where does it come from ?
**[[ListCount]], [[ListIndex]] - how long is the list and which item is currently selected ?
**[[MultiSelect]], [[Selected]] - how to manage multi-select listboxes ?
!!!~OptionGroup and ~RadioButton controls
*How are [[OptionGroups|OptionGroup]] and [[RadioButtons|RadioButton]] related ?
*The [[getOptionGroup]] method of a (sub)form
*The [[OptionValue]] property of a ~RadioButton
!INTROSPECTION
Specific methods are available to manage property //indirection// and property //introspection//.
*[[hasProperty]] determines if a pseudo object has a given property
*[[getProperty]] and [[setProperty]] help managing the value of properties
See also the [[Property]] pseudo object and the [[Properties]] collection.
!SHORTCUTS
A [[shortcut|ShortCut Notation]] is a character string designating unambiguously forms and controls. Next functions help managing them:
*[[getObject]] returns the corresponding pseudo object
*[[getValue]] and [[setValue]] get and set their properties
!ACTIONS
*[[OpenForm]], [[OpenTable]], [[OpenQuery]], [[OpenReport]], [[Close]] - how to open or close //~OpenOffice/~LibreOffice// objects ?
*[[RunSQL]] - how to run action statements ?
*[[FindRecord]], [[FindNext]] - how to search in gridcontrols ?
*[[GoToRecord]] - how to move form records back-and forward ?
*[[Quit]] - quit the application
!DATABASE FUNCTIONS
*Search a single value with [[DLookup]]
*Make totals or similar computations with [[DSum]], [[DAvg]], [[DCount]], [[DMin and DMax|DMin, DMax]]
*Make statistical functions with [[DStDev, DStDevP]], [[DVar and DVarP|DVar, DVarP]] functions
!ERROR HANDLING
*The [[Introduction about error handling|Error Handler]] - to read first
*The [[TraceError]] function may be used by one's own Basic code
*[[TraceLog]] is for user messages or internal debugging information
*The logged information can be displayed by mean of [[TraceConsole]].
!EVENTS HANDLING
*The [[Introduction about event handling|Events Handler]] - to read first
*The [[Events]] collection of ...
*... the [[Event]] pseudo objects with their specific properties
The //Value// property specifies what is the current value of a [[Control]] or an [[OptionGroup]].
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Control]] |~CheckBox<br />~CommandButton<br />[[OptionGroup]] (radiobuttons) |~CheckBox |Determines whether the control is selected. |
|~|[[ComboBox]]<br />[[ListBox]] |[[ComboBox]] |Determines which value is selected in the proposed options. |
|~|~CurrencyField<br />~FormattedField<br />~NumericField<br />~ScrollBar<br />~SpinButton |~CurrencyField<br />~FormattedField<br />~NumericField |Determines the numeric value associated with the control. |
|~|~DateField<br />~TimeField |~DateField<br />~TimeField |Determines the date and/or time value of the control. |
|~|~FileControl<br />~HiddenControl<br />~PatternField<br />~TextField |~PatternField<br />~TextField |Determines the text value contained in the control. |
|[[OptionGroup]]| Integer ||Specifies the currently selected [[RadioButton]]. |
!!!Syntax
//control//{{{.Value}}}
{{{getValue(}}}//control//{{{)}}}
{{{setValue(}}}//control//{{{,}}}//value//{{{)}}}
//optiongroup//{{{.Value}}}
{{{getValue(}}}//optiongroup//{{{)}}}
{{{setValue(}}}//optiongroup//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Variant}}}
!!!Remarks
The //Value// property returns always a single value, even for multiselect [[ListBox]] controls.
If the control or the optiongroup is bound to a database field, changing the value in the control programmatically modifies also the value in the database accordingly.
!!!Error messages
|Argument nr.X is invalid |
|Property 'Value' not applicable in this context |
!!!See also
[[getValue]]
[[setValue]]
[[OptionGroup]]
!!!Example
<<tiddler "Value example">>
Set new value in text field depending on value in combo box
//{{{
Dim ofForm As Object, ocCombo As Object, ocText As Object
Dim vDesc As Variant
Set ofForm = Forms("myForm")
Set ocCombo = Controls(ofForm, "myComboBox")
vDesc = DLookup("DENOMINATION", "CATEGORIES", "[CODE CATEGORY]='" & ocCombo.Value & "'")
If Not IsNull(vDesc) Then
Set ocText = Controls(ofForm, "myTextBox")
setValue(ocText, vDesc)
End If
//}}}
The //Visible// property specifies or determines if a //form// or a //control// in a form or subform is hidden or visible.
!!!Applies to ...
| !Pseudo object | !Type when<br />in a form | !Type when<br />in a ~GridControl |!Description |
|[[Form]] |||An open form |
|[[Control]] |All except<br />--~HiddenControl<br />[[SubForm]]-- | None |A control on an open form |
!!!Syntax
//form//{{{.Visible}}}
{{{getVisible(}}}//form//{{{)}}}
{{{setVisible(}}}//form//{{{,}}}//value//{{{)}}}
//control//{{{.Visible}}}
{{{getVisible(}}}//control//{{{)}}}
{{{setVisible(}}}//control//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Boolean}}}
!!!Remarks
A [[subform|SubForm]] cannot be made hidden programmatically. Neither exists a tabbed interface for forms.
To simulate anyhow such a tabbed interface, one can store in the form several groups of controls by mean of subforms. To make visible one subform while hiding the other ones, have a look at the second example below.
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
|Property 'Visible' not applicable in this context|
!!!Examples
<<tiddler "Visible example">>
Hide a control on a form
//{{{
Dim ocControl As Object
Set ocControl = Controls("myForm", "myControl")
setVisible(ocControl, False)
//}}}
Hide a subform although a subform cannot be made hidden
//{{{
Dim ofSubform As Object, ocControl As Object, i As Integer
ofSubform = getValue("Forms!myForm!mySubForm.Form")
For i = 0 To Controls(ofSubform)Count - 1
Set ocControl = Controls(ofSubform, i)
If hasProperty(CocControl, "Visible") Then setVisible(ocControl, False)
Next i
//}}}
!!Observation:
{{firstletter{
@@color:#930;O@@
}}}penOffice/~LibreOffice Calc, Writer, Impress softwares have proved to be valid alternatives to their //~MSOffice// equivalents. Base has obviously not reached the same success. Try to find on the web examples to download of //~OpenOffice/~LibreOffice Base// databases, code snippets, how to use ... ?
If you compare
*The number of objects, constants, services, interfaces, methods, properties, enumerations in the whole ~OpenOffice/~LibreOffice API - including indeed also Calc, Writer, etc. - is about 20,000.
* The number of collections, objects, methods, properties, constants in the whole //~MSAccess// API - indeed only //~MSAccess// oriented - is about 1,600 including 800 constants.
you will admit that both softwares are functionally extremely rich but also that //~OpenOffice/~LibreOffice requires from an application developer undoubtedly a huge initial effort !//
AND ... can anyone tell me: __why should an application developer know and use the same API as the developer of the software itself ?__
Additionally
*Calc and Writer applications, in most cases, do not require any script programming
*Base, at the opposite, does require such __automation__ capacity __for most business or personal applications__. As a minimum to validate the entered data and avoid database corruption.
!!Conclusion => the 80/20 rule
>''Why not implement the few % of the //~MSAccess// API in //~OpenOffice/~LibreOffice// that cover 80% of the needs ?''
The //Width// property specifies the width of a form
!!!Applies to ...
| !Pseudo object |!Description |
|[[Form]] |An open form |
!!!Syntax
//form//{{{.Width}}}
{{{getWidth(}}}//form//{{{)}}}
{{{setWidth(}}}//form//{{{,}}}//value//{{{)}}}
!!!Returned values / Arguments
{{{Integer}}} or {{{Long}}}
!!!Remarks
!!!Error messages
|Argument nr.X is invalid |
|Form '...' is currently not open|
!!!See also
[[Height]]
[[Maximize]]
[[Minimize]]
[[Move]]
!!!Example
<<tiddler "Height & Width example">>
The //getObject// function returns a [[pseudo-object|Pseudo Object]] designated by its [[shortcut notation|ShortCut Notation]].
!!!Syntax
{{{getObject(}}}//shortcut//{{{)}}}
| !Shortcut |!Returned value |
| String |A pseudo object of types [[Form]] or [[Control]]. Other types are currently not supported. |
!!!See also
[[ShortCut Notation]]
[[getValue]]
[[setValue]]
!!!Example
//{{{
getObject("Forms!myForm!mySubForm.Form!myGridControl!mySubControl")
//}}}
is equivalent to
//{{{
Controls(Controls(getForm(Controls(Forms("myForm"), "mySubForm")), _
"myGridControl"), "mySubControl")
//}}}
The //getOptionGroup// function returns a [[pseudo-object|Pseudo Object]] of type [[OptionGroup]]
!!!Syntax
{{{getOptionGroup(}}}//form, groupname//{{{)}}}
| !Argument | !Type |!Returned value |
|form | [[Form]]<br />[[SubForm]] |A pseudo object of type //~OptionGroup// having the //groupname// as name. The name is that of all radio buttons sharing the same selection group. |
|groupname | string |~|
!!!See also
[[OptionGroup]]
[[RadioButton]]
!!!Example
<<tiddler "Optiongroup example">>
The //getProperty// method returns the current value of any property of any [[pseudo-object|Pseudo Object]].
!!!Applies to ...
| !Object | !Description |
|[[Collection]] |An array of pseudo-objects accessible via their index |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice// database form |
|[[Control]] |The representation of a control within a Form or Subform.<br />The control may be any control type including a [[gridcontrol|GridControl]]. |
|[[SubForm]] |Identifies a specific control which is a subform of a database form or another subform |
|[[Property]] |A name-value pair allowing pseudo-objects introspection |
|[[Event|Events]] |A description of an occurred form or control event |
!!!Syntax
{{{getProperty(}}}//collection//{{{, }}}//property-name//{{{)}}}
{{{getProperty(}}}//control//{{{, }}}//property-name//{{{)}}}
{{{getProperty(}}}//control//{{{, }}}//property-name//{{{, }}}//index//{{{)}}}
{{{getProperty(}}}//subform//{{{, }}}//property-name//{{{)}}}
{{{getProperty(}}}//subform//{{{, }}}//property-name//{{{, }}}//index//{{{)}}}
{{{getProperty(}}}//property//{{{, }}}//property-name//{{{)}}}
{{{getProperty(}}}//event//{{{, }}}//property-name//{{{)}}}
| !Argument #1 | !Type | !Argument #2 | !Type | !Argument #3 | !Type |!Returned value |
| collection | [[Collection object|Collection]] | property-name | String |||Variant or Variant array. |
| control | [[Control object|Control]] | property-name | String | index | absent |~|
|~|~|~|~|~| Integer<br />Long |Variant (or index-th array entry). |
| subform | [[Subform object|SubForm]] | property-name | String | index | absent |Variant or Variant array. |
|~|~|~|~|~| Integer<br />Long |Variant (or index-th array entry). |
| property | [[Property object|Property]] | property-name | String |||Variant or Variant array. |
| event | [[Event object|Event]] | property-name | String |||~|
!!!Remarks
The //index// argument must have a (integer or long) value between 0 and the size of the array associated with the considered //property//.
!!!Error messages
|Argument nr.X is invalid |
|Property '...' not applicable in this context |
|Out of array range or incorrect array size for property '...' |
!!!See also
[[Property]]
[[Properties]]
[[hasProperty]]
[[setProperty]]
!!!Example
The //getValue// function returns a property of a [[pseudo-object|Pseudo Object]] designated by its [[shortcut notation|ShortCut Notation]].
!!!Syntax
{{{getValue(}}}//shortcut//{{{)}}}
| !Shortcut | !Returned value |
| String | Variant |
!!!Remark
If the last component of the //shortcut// is not a property (i.e. the last operator is not a ".") then the property [[Value]] is assumed.
!!!See also
[[ShortCut Notation]]
[[getObject]]
[[setValue]]
The [[Value]] property
!!!Example
//{{{
getValue("Forms!myForm!mySubForm.Form!myGridControl!mySubControl.ControlTipText"
//}}}
is equivalent to
//{{{
getControlTipText(Controls(Controls(getForm(Controls(Forms("myForm"), _
"mySubForm")), "myGridControl"), "mySubControl"))
//}}}
The //hasProperty// method returns //True// if a [[pseudo object|Pseudo Object]] has a specific //property//.
!!!Applies to ...
| !Object | !Description |
|[[Collection]] |An array of pseudo-objects accessible via their index |
|[[Database]] |The single database to which the Base application is connected |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice// database form |
|[[Control]] |The representation of a control within a Form or Subform.<br />The control may be any control type including a [[gridcontrol|GridControl]]. |
|[[SubForm]] |Identifies a specific control which is a subform of a database form or another subform |
|[[OptionGroup]]|The representation of a set of [[RadioButtons|RadioButton]] having the same name. |
|[[Property]] |A name-value pair allowing pseudo-objects introspection |
|[[Event|Events]] |A description of an occurred form or control event |
!!!Syntax
{{{hasProperty(}}}//control//{{{, }}}//property-name//{{{)}}}
| !Argument #1 | !Type | !Argument #2 | !Type |!Returned value |
| control | [[Control object|Control]] | property-name | String | Boolean |
!!!Error messages
|Argument nr.X is invalid |
!!!See also
[[Property]]
[[Properties]]
[[getProperty]]
[[setProperty]]
!!!Example
<<tiddler "setProperty example">>
The //setFocus// method moves the focus to the specified form or to the specified control on the active form.
!!!Applies to ...
| !Object | !Description |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice Base// database [[form|Form]] |
|[[Control]] |The representation of a control within a [[form|Form]], a [[subform|SubForm]] or a [[gridcontrol|GridControl]] |
!!!Syntax
{{{setFocus(}}}//form//{{{)}}}
{{{setFocus(}}}//control//{{{)}}}
| !Argument #1 | !Type | !Returned value |
| form | [[Form object|Form]] | //True// if success. |
| control | [[Control object|Control]] |~|
!!!Remarks
!!!Error messages
|Argument nr.1 is invalid |
|Control '...' not found in gridcontrol '...' |
!!!See also
[[FindRecord]]
[[SelectObject]]
!!!Example
<<tiddler "setFocus example">>
Set focus on named control
//{{{
Dim sControl As String
setFocus(getObject("Forms!myForm!myControl"))
//}}}
The //setProperty// method modifies the current value of any modifiable property of [[pseudo-objects|Pseudo Object]].
!!!Applies to ...
| !Object | !Description |
|[[Form]] |The representation of an //~OpenOffice/~LibreOffice Base// database form. |
|[[Control]] |The representation of a control within a Form or Subform.<br />The control may be any control type including a [[gridcontrol|GridControl]]. |
|[[SubForm]] |Identifies a specific control which is a subform of a database form or another subform. |
!!!Syntax
{{{setProperty(}}}//form//{{{, }}}//property-name//{{{, }}}//value//{{{)}}}
{{{setProperty(}}}//control//{{{, }}}//property-name//{{{, }}}//value//{{{)}}}
{{{setProperty(}}}//control//{{{, }}}//property-name//{{{, }}}//value//{{{, }}}//index//{{{)}}}
{{{setProperty(}}}//subform//{{{, }}}//property-name//{{{, }}}//value//{{{)}}}
{{{setProperty(}}}//subform//{{{, }}}//property-name//{{{, }}}//value//{{{, }}}//index//{{{)}}}
| !Argument #1 | !Type | !Argument #2 | !Type | !Argument #3 | !Type | !Argument #4 | !Type | !Returned value |
| form | [[Form object|Form]] | property-name | String | value |Variant ||| //True// if success. |
| control | [[Control object|Control]] | property-name | String | value |Variant | index | absent |~|
|~|~|~|~|~|~|~| Integer<br />Long |~|
| subform | [[Subform object|SubForm]] | property-name | String | value |Variant | index | absent |~|
|~|~|~|~|~|~|~| Integer<br />Long |~|
!!!Remarks
The //index// argument must have a (integer or long) value between 0 and the size of the array associated with the considered //property//.
!!!Error messages
|Argument nr.X is invalid |
|Property '...' not applicable in this context |
|Value '...' is invalid for property '...' |
|Out of array range or incorrect array size for property '...' |
!!!See also
[[Property]]
[[Properties]]
[[hasProperty]]
[[getProperty]]
!!!Example
<<tiddler "setProperty example">>
Set all enabled controls on a form in italic
//{{{
Dim ofForm As Object, i As Integer, iCount As Integer, ocControl As Object
Set ofForm = Forms("myForm")
iCount = Controls(ofForm).Count
For i = 0 To iCount - 1
Set ocControl = Controls(ofForm, i)
If hasProperty(ocControl, "FONTITALIC") Then
If hasProperty(ocControl, "ENABLED") Then
If ocControl.Enabled Then setProperty(ocControl, "FONTITALIC", True)
End If
End If
Next i
//}}}
The //setValue// function sets a property of a [[pseudo-object|Pseudo Object]] designated by its [[shortcut notation|ShortCut Notation]].
!!!Syntax
{{{setValue(}}}//shortcut, value//{{{)}}}
| !Shortcut | !Value |!Returned value |
| String | Variant |Boolean. True if success. |
!!!Remark
If the last component of the //shortcut// is not a property (i.e. the last operator is not a ".") then the property [[Value]] is assumed.
The //setValue// does not allow to set a single element of an array if the property returns an array. However setting all the elements at once is allowed.
!!!See also
[[ShortCut Notation]]
[[getObject]]
[[getValue]]
The [[Value]] property
!!!Example
//{{{
setValue("Forms!myForm!mySubForm.Form!myGridControl!mySubControl.ControlTipText", "New tip")
//}}}
is equivalent to
//{{{
setControlTipText(Controls(Controls(getForm(Controls(Forms("myForm"), _
"mySubForm")), "myGridControl"), "mySubControl"), "New tip")
//}}}
Type the text for 'systemConfig'