Adobe Dreamweaver Forums



Last 10 THreads :         Re: CS4 GPU Acceleration and Intel X3100 (Last Post : Paul_B_Brown@adobeforums.com - Replies : 0 - Views : 1 )           »          error 1034 (Last Post : shottogan - Replies : 0 - Views : 1 )           »          Keyboard events don't work in player or projector (Last Post : tunghoy - Replies : 0 - Views : 1 )           »          Help with caption box question (Last Post : NZ-developer - Replies : 1 - Views : 2 )           »          Realistic Cat Hair and... (Last Post : chrisf111 - Replies : 0 - Views : 1 )           »          PLACING NEW LAYER BELOW THE ORIGINAL (Last Post : dave_milbut@adobeforums.com - Replies : 3 - Views : 4 )           »          Re: CS4 bug: brush cursor display is incomplete (Last Post : sam_shand@adobeforums.com - Replies : 0 - Views : 1 )           »          PS CS4 "Save As ..." format choices appear in duplicate (Last Post : dave_milbut@adobeforums.com - Replies : 5 - Views : 6 )           »          CreateODBCDate and cfqueryparam with cf_sql_date (Last Post : Dan Bracuk - Replies : 2 - Views : 3 )           »          Strip EXIF camera data from PSD files? (Last Post : Ho - Replies : 1 - Views : 2 )           »         


User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-03-2008, 04:38 AM
rspitler
 
Posts: n/a
Diggs:
Default Datagrid Scrolling Issue

I have seen a couple posts around somewhat similar problems but none of those
workarounds seem to address my issue. I am hoping that there is a viable
solution as i think this should be a pretty straightforward usecase. I am
trying to use the datagrid to display a source file. Each row in the grid
corresponds to a single line in the source file. Using a datagrid gives me
great control over the rendering of each line as well as an easy mechanism for
storing high level metainformation about the code constructs represented by
that row enabling very dynamic navigation through the codebase. In addition it
is easy for me to chunk and paginate through large files. All of these
benefits led me to this implementation. The one major issue that I am having
is the horizontal scrolling of the grid. I have set up the grid so that it uses
two columns, one representing the gutter of the source file and the other
representing the text. This requires the second columns to be capable of
displaying arbitrarily long lines of text (and wrapping is not a reasonable
option). Because the second column is of a arbitrary size i need to enable
horizontal scrolling on the datagrid to allow access to the information that
could spill off the edge of the screen. I have tried a few approaches to this
problem and have found no reasonable solution. If i set the width of the
datagrid to be a large size then i get the appropriate horizontal scroll bar
but no vertical on(it is pushed off the screen). If i set the maxWidth of the
data grid and increase the width of the second column i get strange behavior
where the horizontal and vertical scroll show up properly but the horizontal
scroll does not really enable navigation - the slider is half the width of the
scroll bar and when scrolled all the way to the right it causes the grid to
scroll but only a small fraction of the necessary distance.

I am incredibly frustrated right now. This is a very powerful and flexible
solution for my problem and i am thwarted by what seems to be a trivial bug. I
am scared i may have to reimplement everything i have done so far if i can not
solve this issue.

Thank you for your time
Russ


<Canvas xmlns:mx="http://www.adobe.com/2006/mxml" verticalScrollPolicy="off"
horizontalScrollPolicy="off">
<mx:Script>
<![CDATA[
import mx.events.ResizeEvent;
import mx.collections.IViewCursor;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.managers.CursorManager;

[Bindable]
private var itemAC:ArrayCollection;

public override function onCreationComplete(event:Event):void{
this.addEventListener(ResizeEvent.RESIZE, resize);
}
public var issueList:IssueList;


private function resize(event:ResizeEvent):void{
this.invalidateSize(); //causes canvas to be remeasured just
before resizeIt()
callLater(resizeIt); //this will do the resize after we get
actual size of canvas
}
private function resizeIt():void{
if(dg.measuredWidth > this.width){
dg.maxWidth = this.width;
dg.width = Number.NaN;
}
else{
//if the sum of all columns widths is less than the width of
the canvas
//then max the width to prevent deadspace
dg.width = this.width;
dg.maxWidth = Number.NaN;
}
dg.maxHeight = this.height;
}
public function resetWidth():void{
//sourceCol.width =
RenderedSourceFileVO(model.collections.get(DataCon stants.ENTITY_CURRENT_SOURCEFI
LE)).maxLength;
}

]]>
</mx:Script>
<mxataGrid
dataProvider="{RenderedSourceFileVO(model.collecti ons.get(DataConstants.ENTITY_C
URRENT_SOURCEFILE)).lineInfos}"
showHeaders="false"
variableRowHeight="true"
sortableColumns="false"
allowMultipleSelection="false"
mouseFocusEnabled="false"
id="dg"
dragEnabled="false"
dropEnabled="false"
dragMoveEnabled="false"
horizontalScrollPolicy="auto"
height="100%">
<mx:columns>
<mxataGridColumn width="40" >
<mx:itemRenderer>
<mx:Component>

<mx:Label height="5" text="{(data is TraceElementLineInfoVO ?
'':data.sourceLineNumber)}">
<mx:Script>
<![CDATA[

import com.fortify.manager.vo.TraceElementLineInfoVO;
]]>
</mx:Script>
</mx:Label>
</mx:Component>
</mx:itemRenderer>
</mxataGridColumn>
<mxataGridColumn id="sourceCol" dataField="renderedText" >
<mx:itemRenderer>

<mx:Component>
<mx:HBox verticalGap="0" width="100%" horizontalGap="0"
height="100%" initialize="init()" >
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import com.ericfeminella.utils.QueryString;
import com.ericfeminella.utils.IQueryString;
import mx.events.ScrollEvent;
import com.fortify.manager.vo.LineInfoVO;
import com.fortify.manager.vo.TraceElementLineInfoVO;
import mx.controls.DataGrid;
import com.fortify.manager.model.FMModelLocator;


override protected function measure():void{
super.measure();
//override the two line minimum size for textarea
this.measuredHeight =15;

}


]]>
</mx:Script>
<mx:TextArea
selectable="true"
id="sourceText"
paddingTop="0"
paddingBottom="0"
borderThickness="0"
styleName="sourcePanel"
width="100%"
height="100%"

styleSheet="{FMModelLocator.getInstance().sourceSt yleSheet}"
wordWrap="false"
condenseWhite="true"
editable="false"
horizontalScrollPolicy="off"


link="outerDocument.issueList.onClickLink(event)"
doubleClick="doubleClick(event)"
text="{LineInfoVO(data).renderedText}"
/>

</mx:HBox>

</mx:Component>
</mx:itemRenderer>
</mxataGridColumn>
</mx:columns>
</mxataGrid>

</Canvas>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-03-2008, 04:38 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Datagrid Scrolling Issue


"rspitler" <webforumsuser@macromedia.com> wrote in message
news:gdt1dc$9e1$1@forums.macromedia.com...
>I have seen a couple posts around somewhat similar problems but none of
>those
> workarounds seem to address my issue. I am hoping that there is a viable
> solution as i think this should be a pretty straightforward usecase. I am
> trying to use the datagrid to display a source file. Each row in the grid
> corresponds to a single line in the source file. Using a datagrid gives
> me
> great control over the rendering of each line as well as an easy mechanism
> for
> storing high level metainformation about the code constructs represented
> by
> that row enabling very dynamic navigation through the codebase. In
> addition it
> is easy for me to chunk and paginate through large files. All of these
> benefits led me to this implementation. The one major issue that I am
> having
> is the horizontal scrolling of the grid. I have set up the grid so that it
> uses
> two columns, one representing the gutter of the source file and the other
> representing the text. This requires the second columns to be capable of
> displaying arbitrarily long lines of text (and wrapping is not a
> reasonable
> option). Because the second column is of a arbitrary size i need to
> enable
> horizontal scrolling on the datagrid to allow access to the information
> that
> could spill off the edge of the screen. I have tried a few approaches to
> this
> problem and have found no reasonable solution. If i set the width of the
> datagrid to be a large size then i get the appropriate horizontal scroll
> bar
> but no vertical on(it is pushed off the screen). If i set the maxWidth of
> the
> data grid and increase the width of the second column i get strange
> behavior
> where the horizontal and vertical scroll show up properly but the
> horizontal
> scroll does not really enable navigation - the slider is half the width of
> the
> scroll bar and when scrolled all the way to the right it causes the grid
> to
> scroll but only a small fraction of the necessary distance.
>


Something went drastically wrong with your formatting. All the paragraph
breaks were lost, and I find this impossible to parse. Care to try again
and add extra space so your paragraphs are respected?


Reply With Quote
  #3 (permalink)  
Old 11-03-2008, 04:38 AM
rspitler
 
Posts: n/a
Diggs:
Default Re: Datagrid Scrolling Issue

[q]Originally posted by: rspitler
I have seen a couple posts around somewhat similar problems but none of those
workarounds seem to address my issue. I am hoping that there is a viable
solution as i think this should be a pretty straightforward usecase. I am
trying to use the datagrid to display a source file. Each row in the grid
corresponds to a single line in the source file. Using a datagrid gives me
great control over the rendering of each line as well as an easy mechanism for
storing high level metainformation about the code constructs represented by
that row enabling very dynamic navigation through the codebase. In addition it
is easy for me to chunk and paginate through large files.

All of these benefits led me to this implementation. The one major issue that
I am having is the horizontal scrolling of the grid. I have set up the grid so
that it uses two columns, one representing the gutter of the source file and
the other representing the text. This requires the second columns to be
capable of displaying arbitrarily long lines of text (and wrapping is not a
reasonable option).

Because the second column is of a arbitrary size i need to enable horizontal
scrolling on the datagrid to allow access to the information that could spill
off the edge of the screen. I have tried a few approaches to this problem and
have found no reasonable solution. If i set the width of the datagrid to be a
large size then i get the appropriate horizontal scroll bar but no vertical
on(it is pushed off the screen). If i set the maxWidth of the data grid and
increase the width of the second column i get strange behavior where the
horizontal and vertical scroll show up properly but the horizontal scroll does
not really enable navigation - the slider is half the width of the scroll bar
and when scrolled all the way to the right it causes the grid to scroll but
only a small fraction of the necessary distance.

I am incredibly frustrated right now. This is a very powerful and flexible
solution for my problem and i am thwarted by what seems to be a trivial bug. I
am scared i may have to reimplement everything i have done so far if i can not
solve this issue.

Thank you for your time
Russ
[/q]



Reply With Quote


  #4 (permalink)  
Old 11-03-2008, 04:38 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Datagrid Scrolling Issue


"rspitler" <webforumsuser@macromedia.com> wrote in message
news:gdtglu$t4e$1@forums.macromedia.com...
> [q]Originally posted by: rspitler
> I have seen a couple posts around somewhat similar problems but none of
> those
> workarounds seem to address my issue. I am hoping that there is a viable
> solution as i think this should be a pretty straightforward usecase. I am
> trying to use the datagrid to display a source file. Each row in the grid
> corresponds to a single line in the source file. Using a datagrid gives
> me
> great control over the rendering of each line as well as an easy mechanism
> for
> storing high level metainformation about the code constructs represented
> by
> that row enabling very dynamic navigation through the codebase. In
> addition it
> is easy for me to chunk and paginate through large files.
>
> All of these benefits led me to this implementation. The one major issue
> that
> I am having is the horizontal scrolling of the grid. I have set up the
> grid so
> that it uses two columns, one representing the gutter of the source file
> and
> the other representing the text. This requires the second columns to be
> capable of displaying arbitrarily long lines of text (and wrapping is not
> a
> reasonable option).
>
> Because the second column is of a arbitrary size i need to enable
> horizontal
> scrolling on the datagrid to allow access to the information that could
> spill
> off the edge of the screen. I have tried a few approaches to this problem
> and
> have found no reasonable solution. If i set the width of the datagrid to
> be a
> large size then i get the appropriate horizontal scroll bar but no
> vertical
> on(it is pushed off the screen). If i set the maxWidth of the data grid
> and
> increase the width of the second column i get strange behavior where the
> horizontal and vertical scroll show up properly but the horizontal scroll
> does
> not really enable navigation - the slider is half the width of the scroll
> bar
> and when scrolled all the way to the right it causes the grid to scroll
> but
> only a small fraction of the necessary distance.
>
> I am incredibly frustrated right now. This is a very powerful and
> flexible
> solution for my problem and i am thwarted by what seems to be a trivial
> bug. I
> am scared i may have to reimplement everything i have done so far if i can
> not
> solve this issue.
>
> Thank you for your time


I'd maybe go with something a little more user friendly, such as using
variableRowHeight so it can wrap, truncating and showing a button that can
pop up a TitleWindow with the full text inside, or having a text field
somewhere that is bound to that field in the selectedItem. You could also
go with a fixed row height, but scrolling within a relatively tall TextArea
or something within it.

I hate really wide scrolling windows myself.

Hope this helps;

Amy


Reply With Quote
  #5 (permalink)  
Old 11-03-2008, 04:38 AM
rspitler
 
Posts: n/a
Diggs:
Default Re: Datagrid Scrolling Issue

Those are both really good suggestions, but the one usecase that they dont
quite address is the situation where the flow of the source code causes the
entire section of code to be offset by a margin that would place it out of the
viewable area. For a single line overruning or a few it makes sense to wrap or
collapse them, but when there are a number of lines in a row that are
significantly offset then having the user select and viwe the content in
another viewer for each line becomes a pretty tall order. Though maybe if i
toggle the line wrap that might help. The real issue is developers are picky
on how they view there source code ...

Reply With Quote
  #6 (permalink)  
Old 11-03-2008, 04:38 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Datagrid Scrolling Issue


"rspitler" <webforumsuser@macromedia.com> wrote in message
news:gdtjm5$3jb$1@forums.macromedia.com...
> Those are both really good suggestions, but the one usecase that they dont
> quite address is the situation where the flow of the source code causes
> the
> entire section of code to be offset by a margin that would place it out of
> the
> viewable area. For a single line overruning or a few it makes sense to
> wrap or
> collapse them, but when there are a number of lines in a row that are
> significantly offset then having the user select and viwe the content in
> another viewer for each line becomes a pretty tall order. Though maybe if
> i
> toggle the line wrap that might help. The real issue is developers are
> picky
> on how they view there source code ...


I seem to recall that your issue may be fixable by setting minHeight and/or
minWidth to 0.

Worth a try, anyway.

HTH;

Amy


Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 03:05 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk