Click here to Skip to main content
15,921,840 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dialog dissapears... ? Pin
Antti Keskinen23-Jan-04 23:57
Antti Keskinen23-Jan-04 23:57 
GeneralRe: Dialog dissapears... ? Pin
Calder24-Jan-04 4:08
Calder24-Jan-04 4:08 
GeneralRe: Dialog dissapears... ? Pin
Antti Keskinen24-Jan-04 21:22
Antti Keskinen24-Jan-04 21:22 
GeneralRe: Dialog dissapears... ? Pin
Calder25-Jan-04 12:15
Calder25-Jan-04 12:15 
GeneralRe: Dialog dissapears... ? Pin
Antti Keskinen26-Jan-04 5:24
Antti Keskinen26-Jan-04 5:24 
Generalshow/hide a pane in static splitter window Pin
gailya23-Jan-04 21:57
gailya23-Jan-04 21:57 
GeneralRe: show/hide a pane in static splitter window Pin
Antti Keskinen23-Jan-04 23:00
Antti Keskinen23-Jan-04 23:00 
GeneralCScrollview data plotting & grabbing the plotted data Pin
JHAKAS23-Jan-04 19:41
JHAKAS23-Jan-04 19:41 
CScrollview data plotting & grabbing the plotted data

>> Confused | :confused:
Mainly how to find what is the position of mouse pointer when clicked corresponding to data plotted

Hello friends

I am developing an application in which i have to
1.0 Get the data from file
2.0 Store it to array
3.0 Plot the data with MM_LOENGLISH mapping mode on view
(because i want printous as it is)
4.0 Allow user to grab the data from the view by clicking on the
selected portion from the view, say marquee select
5.0 Corresponding to user selection on view, grab the dat from
the array and then put the data into seperate file.


I am having query in point 4.0:

How can one implement the functionality in which the data has to be plotted on UI and certain part of data has to be grabbed from the visual display.

How the exact position of mouse is located on UI vis a vis data in array? (I want to grab the data on UI by selecting the data , there has to be a mapping with the array data?)

So that when i grab on UI i get some value on mouse clicking and then based on that i can grab the data?

No matter what ever the OS is i.e 2000 or Xp or 98.
No matter what ever the screen resolution is (It must work for all combination)


What i am doing presently is :

i am taking data from the document

Step 3.0 onwards


<br />
  // Declare CPoint variables<br />
  CPoint OldPointL, NewPointL;<br />
<br />
  // Get the total sizes<br />
  CSize sizeTotal;<br />
  sizeTotal = GetTotalSize();<br />
  long interval = (long)(((sizeTotal.cy * 0.95f) / 5)*0.9f);<br />
<br />
  if(m_bFitToScale == true)<br />
  {<br />
     m_ScaleX = (float)ClientRect.Width () / <br />
                (float)pDoc->m_ChannelDataArray.GetSize () ;<br />
  }<br />
  else<br />
  {<br />
     m_ScaleX = 1;<br />
  }<br />
  // STart Point is ClientRect.left<br />
  OldPointL.x = ClientRect.left;<br />
<br />
  int Ly = OldPointL.y = (long)(ClientRect.top - ClientRect.Height () *   0.95f);<br />
  // Scaling factor for Y scale . GetMaxValue() return max. value <br />
  // from the data array in doc<br />
  m_GeoYScale = interval * 0.5f/ceilf(GetMaxValue());<br />
<br />
  // Get data stored to array in Document<br />
  for(int xCount=0; xCount < pDoc->m_ChannelDataArray.GetSize (); xCount++)<br />
  {<br />
      // L - Channel Display<br />
      NewPointL.x = (int)(m_LeftMargin + xCount * m_ScaleX) ;<br />
      NewPointL.y = (int)( Ly + m_GeoYScale * data->GetLValue ()) ;<br />
      // Custom built CLine class (start point, end point, color and width)<br />
      CLine *pL = new CLine((float)OldPointL.x, (float)OldPointL.y,<br />
                             (float)NewPointL.x, (float)NewPointL.y, <br />
                             RGB(255, 0, 0), 1);<br />
       // Add line to document<br />
      pDoc->AddLine(pL);<br />
      OldPointL = NewPointL; // For next line<br />
}<br />


After this Invalidate is called and in ondraw i am drawing all the lines and labels ?


For step 4.0 i am going for onXButtonUp function


StartPoint = ScrollView.GetPosition() + point.x
(Point recd. from Onxbuttonup function)

Startpoint on left button and endpoint on R button

NOW MAIN TASK IS TO GRAB THE DATA FROM THE DATA ARRAY IN DOC BASED ON GRAB SELECTION ON VIEW


ANy help suggestion Please soon

I am not expert in this and i am learning, kindly can you give me sugestion?

I had posted the same theme query
http://www.codeguru.com/forum/showt...threadid=279607


Thanks







Leave your mark wherever you go
GeneralDisplaying text in MDI Pin
hurr1can323-Jan-04 19:32
hurr1can323-Jan-04 19:32 
GeneralRe: Displaying text in MDI Pin
Antti Keskinen23-Jan-04 23:04
Antti Keskinen23-Jan-04 23:04 
GeneralHelp the Newbie(plz) Pin
MrNiceBerG23-Jan-04 18:46
MrNiceBerG23-Jan-04 18:46 
GeneralRe: Help the Newbie(plz) Pin
monrobot1323-Jan-04 20:33
monrobot1323-Jan-04 20:33 
GeneralRe: Help the Newbie(plz) Pin
Antti Keskinen23-Jan-04 23:24
Antti Keskinen23-Jan-04 23:24 
GeneralRe: Help the Newbie(plz) Pin
MrNiceBerG24-Jan-04 5:19
MrNiceBerG24-Jan-04 5:19 
GeneralRe: Help the Newbie(plz) Pin
MrNiceBerG27-Jan-04 18:55
MrNiceBerG27-Jan-04 18:55 
GeneralDetachable tab control... Pin
Neha23-Jan-04 18:14
Neha23-Jan-04 18:14 
GeneralRe: Detachable tab control... Pin
Antti Keskinen23-Jan-04 22:43
Antti Keskinen23-Jan-04 22:43 
GeneralRe: Detachable tab control... Pin
Marcello25-Jan-04 8:15
Marcello25-Jan-04 8:15 
GeneralProblem in SearchPath Pin
SiddharthAtw23-Jan-04 17:46
SiddharthAtw23-Jan-04 17:46 
GeneralRe: Problem in SearchPath Pin
Mukkie25-Jan-04 7:56
Mukkie25-Jan-04 7:56 
GeneralRe: Problem in SearchPath Pin
SiddharthAtw26-Jan-04 17:24
SiddharthAtw26-Jan-04 17:24 
GeneralRe: Problem in SearchPath Pin
Mukkie27-Jan-04 7:35
Mukkie27-Jan-04 7:35 
GeneralRe: Problem in SearchPath Pin
SiddharthAtw28-Jan-04 21:42
SiddharthAtw28-Jan-04 21:42 
GeneralRe: Problem in SearchPath Pin
Mukkie29-Jan-04 5:50
Mukkie29-Jan-04 5:50 
GeneralRe: Problem in SearchPath Pin
SiddharthAtw29-Jan-04 22:14
SiddharthAtw29-Jan-04 22:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.