FORUMS: list search recent posts

list in tabbed panel won't fill on resize

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dror Lazar
list in tabbed panel won't fill on resize
on Jun 26, 2016 at 5:48:38 am

hi
i'm getting weird results when i try to resize my panel, i have 2 tabbed panels, each containing a list, they show nice initially, but when i try to resize the panel they act weird, i have to resize vert/ horz to make them fill the space again, but in my lower panel (that also contains list) the behavior it perfect, is it a bug with the tabbed panel? did i miss something on the way?
any help will be appreciated
thanks
D

function createUserInterface (thisObj,userInterfaceString,scriptName){
var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName,
undefined,{resizeable: true});
if (pal == null) return pal;

var UI=pal.add(userInterfaceString);

pal.layout.layout(true);
pal.layout.resize();
pal.onResizing = pal.onResize = function () {
this.layout.resize();
}
if ((pal != null) && (pal instanceof Window)) {
pal.show();
}
return UI;
};






{var res ="group {orientation:'column',\
alignment:['fill','fill'],\
alignChildren:['fill','fill'],\
listPanel:Panel{type:'tabbedpanel', alignment:['fill','fill'], alignChildren:['fill','fill'],\
rqList:Panel{type:'tab', text:'All', alignment:['fill','fill'], alignChildren:['fill','fill'], \
folderPathListbox:ListBox{ \
properties:{ multiline:true, multiselect:true, numberOfColumns:6, showHeaders:true,\
columnTitles: ['#','OM','Date','Time', 'Comp Name', 'Render Path']}\
},\
}\
resultsList:Panel{type:'tab', text:'Results', alignment:['fill','fill'], alignChildren:['fill','fill'],\
resultsListbox:ListBox{ \
properties:{ multiline:true, multiselect:true, numberOfColumns:6, showHeaders:true,\
columnTitles: ['#','OM','Date','Time', 'Comp Name', 'Render Path']}\
},\
}\
}\
buttonGroup:Group{orientation:'row',\
alignment:['fill','bottom']\
alignChildren:['fill','top'],\
buttonPanel: Panel{ text:'Actions', orientation: 'column',alignment:['left','bottom']\
refButton: Button{text:'Refresh'}\
dupButton: Button{text:'Duplicate'}\
delButton: Button{text:'Delete'}\
}\
searchPanel: Panel{\
text:'Search', orientation: 'column',alignment:['left','fill']alignChildren:['left','fill'],\
searchBox: EditText{text:'use & to search 2 values', characters: 20},\
typeGrp: Group{orientation:'row',\
searchDate: RadioButton{text:'Date'}\
searchComp: RadioButton{text:'Comp'}\
searchFile: RadioButton{text:'Path'}\
}\
buttonGrp: Group{orientation:'row',\
searchButton: Button{text:'Search', alignment:['right','fill']}, \
clearListButton: Button{text:'Clear Results',alignment:['right','fill'] }\
}\
}\
textPanel: Panel{\
text:'Search results', orientation: 'column', alignment:['fill','fill'], alignChildren:['fill','fill'],\
searchRes: ListBox{\
alignment:['fill','fill'], properties:{ multiline:true, numberOfColumns:2, showHeaders:true,\
columnTitles: ['searched','Found in RQ #']}\
},\
}\
}\
}";

}
function listRQ (rqList){
try{
var folderPathListbox = rqList;
var proj = app.project;
var totalRenderQ = proj.renderQueue.numItems;
for(var i= 1; i&lt;=totalRenderQ; i++){
var totalOM= proj.renderQueue.item(i).numOutputModules;
for (var om= 1; om&lt;=totalOM; om++){
var dateList, timeList, curItem, outputs;
if (totalOM == 1){
outputs = "";
}else{
outputs = om;
}
if (proj.renderQueue.item(i).startTime != null){
var min = proj.renderQueue.item(i).startTime.getMinutes() &lt;10 ? "0"+ proj.renderQueue.item(i).startTime.getMinutes() : proj.renderQueue.item(i).startTime.getMinutes();
var year = proj.renderQueue.item(i).startTime.getFullYear().toString().substr (-2,2);
timeList = (proj.renderQueue.item(i).startTime.getHours())+":" + min;
dateList =proj.renderQueue.item(i).startTime.getDate()+"/"+(proj.renderQueue.item(i).startTime.getMonth()+1)+"/"+year ;
}else{
dateList = "not ";
timeList = "rendered";
}
curItem = folderPathListbox.add ('item', i ); // Column 1
curItem.subItems[0].text = outputs; // Column 2
curItem.subItems[1].text = dateList.toString(); // Column 3
curItem.subItems[2].text = timeList.toString(); // Column 4
curItem.subItems[3].text = proj.renderQueue.item(i).comp.name; // Column 5
curItem.subItems[4].text = proj.renderQueue.item(i).outputModule(om).file ==null ? "Not yet specified" : proj.renderQueue.item(i).outputModule(om).file.toString().replace(new RegExp(",","g"), "\r").replace(new RegExp("%20","g"), " ").replace(new RegExp("%5B","g"), "[").replace(new RegExp("%5D","g"), "]"); // Column 6
}
}
}catch(err){alert(err)}
return folderPathListbox;
}
var UI = createUserInterface(this,res,"List Render Queue");
var myList = UI.listPanel.rqList.folderPathListbox;
var lsRq = listRQ(myList);

{ // buttons action
UI.buttonGroup.buttonPanel.refButton.onClick = function () {
lsRq.removeAll();
listRQ(myList);
writeLn("all done");
}
UI.buttonGroup.buttonPanel.dupButton.onClick = function () {
var lstSlct = new Array() ;
var rqId = new Array();
lstSlct = myList.selection;
totalSelect = lstSlct.length;
if ( lstSlct != null){
try{
for (var j = 0; j<totalSelect; j++ ){
if(j+1 != totalSelect){
if (lstSlct[j].toString() !=lstSlct[j+1].toString() ){
rqId[rqId.length] = lstSlct[j].toString();
}
}else{
rqId[rqId.length] = lstSlct[j].toString();
}
}
}catch (err){
//nothing
}

var totalDup = rqId.length;
for (var i= 0; i<totalDup; i++){
var dup = parseInt(rqId[i]);
app.project.renderQueue.item(dup).duplicate();
writeLn("duplicated #"+dup.toString());
}
}else{
alert ("select Something");
}
lsRq.removeAll();
listRQ(myList);
}

UI.buttonGroup.buttonPanel.delButton.onClick = function () {
var lstSlct = new Array() ;
var rqId = new Array();
lstSlct = myList.selection;
totalSelect = lstSlct.length;
if ( lstSlct != null){
try{
for (var j = 0; j<totalSelect; j++ ){
if(j+1 != totalSelect){
if (lstSlct[j].toString() !=lstSlct[j+1].toString() ){
rqId[rqId.length] = lstSlct[j].toString();
}
}else{
rqId[rqId.length] = lstSlct[j].toString();
}
}
}catch (err){
//nothing
}
var totalDel = rqId.length;
var rqIdDel = new Array ();
rqIdDel = rqId.sort(function(a, b){return b-a});
for (var i= 0; i0){
try{
var newFound = new Array();
for (var j = 0; j<found.length; j++ ){
if(j+1 != found.length){
if (found[j].toString() !=found[j+1].toString() ){
newFound[newFound.length] = found[j].toString();
}
}else{
newFound[newFound.length] = found[j].toString();
}
}
}catch (err){
//nothing
}


resList.subItems[0].text = newFound.toString();

}else{
resList.subItems[0].text = "nothing found";
//~ alert("not found");
}

}//else end

}// searchPanel.searchButton function end

UI.buttonGroup.searchPanel.buttonGrp.clearListButton.onClick = function (){
UI.buttonGroup.textPanel.searchRes.removeAll();
}
} //button section End




Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]