Click here to Skip to main content
15,915,160 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC on LINUX Pin
Jon Hulatt7-Oct-02 22:03
Jon Hulatt7-Oct-02 22:03 
GeneralRe: MFC on LINUX Pin
Anonymous8-Oct-02 1:51
Anonymous8-Oct-02 1:51 
QuestionHow do you capture a "Ctrl + A" key combo? Pin
Anonymous7-Oct-02 12:10
Anonymous7-Oct-02 12:10 
AnswerRe: How do you capture a "Ctrl + A" key combo? Pin
Christian Graus7-Oct-02 12:18
protectorChristian Graus7-Oct-02 12:18 
GeneralRe: How do you capture a "Ctrl + A" key combo? Pin
Anonymous7-Oct-02 12:35
Anonymous7-Oct-02 12:35 
GeneralRe: How do you capture a "Ctrl + A" key combo? Pin
Christian Graus7-Oct-02 12:38
protectorChristian Graus7-Oct-02 12:38 
GeneralLineTo Pin
BlackKettle7-Oct-02 11:10
BlackKettle7-Oct-02 11:10 
GeneralRe: LineTo Pin
Joaquín M López Muñoz7-Oct-02 11:44
Joaquín M López Muñoz7-Oct-02 11:44 
If I understood it right, you want to determine, prior to drawing it, at which x does a segment intersect the x axis (if it does): this can be done with a little of trivial algebra, no need to draw the line pixel by pixel. So, this function determines whether a given segment crosses the x axis, and, if so, changes its end point so that the segment ends precisely on the intersection:
bool adjust_to_x_axis(int x0,int y0,&int x1,&int y1)
/* returns true if adjustment was made */
{
  if(x0==x1){
    if(y0<=0){
      if(y1>=0){
        y1=0;
        return true;
      }
      else return false;
    }
    else if(y1<=0){
      if(y0>=0){
        y1=0;
        return true;
      }
      else return false;
    }
  }
  int x_int=x0-y0*(x1-x0)/(y1-y0);
  if(x0<x1){
    if(x0<=x_int&&x_int<=x1){
      x1=x_int;
      y1=0;
      return true;
    }
    else return false;
  }
  else if(x0>=x_int&&x_int>=x1){
    x1=x_int;
    y1=0;
    return true;
  }
  else return false;
}


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: LineTo Pin
Stephane Rodriguez.7-Oct-02 19:51
Stephane Rodriguez.7-Oct-02 19:51 
GeneralRe: LineTo Pin
Joaquín M López Muñoz7-Oct-02 19:59
Joaquín M López Muñoz7-Oct-02 19:59 
GeneralRe: LineTo Pin
Stephane Rodriguez.7-Oct-02 20:11
Stephane Rodriguez.7-Oct-02 20:11 
GeneralRe: LineTo Pin
Joaquín M López Muñoz7-Oct-02 20:46
Joaquín M López Muñoz7-Oct-02 20:46 
GeneralRe: LineTo Pin
Mike Nordell8-Oct-02 0:54
Mike Nordell8-Oct-02 0:54 
GeneralHHHHEEEEELLLLPPPPPP!!! Pin
MFC is the Best7-Oct-02 11:04
MFC is the Best7-Oct-02 11:04 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
Max Santos7-Oct-02 11:11
Max Santos7-Oct-02 11:11 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
Giles7-Oct-02 11:24
Giles7-Oct-02 11:24 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
Christian Graus7-Oct-02 12:05
protectorChristian Graus7-Oct-02 12:05 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
Giles8-Oct-02 8:17
Giles8-Oct-02 8:17 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
mishgun7-Oct-02 17:59
mishgun7-Oct-02 17:59 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
Christian Graus7-Oct-02 12:07
protectorChristian Graus7-Oct-02 12:07 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
MFC is the Best7-Oct-02 13:26
MFC is the Best7-Oct-02 13:26 
GeneralRe: HHHHEEEEELLLLPPPPPP!!! Pin
Chris Losinger7-Oct-02 13:47
professionalChris Losinger7-Oct-02 13:47 
GeneralDisplaying XML Pin
google_4477-Oct-02 10:49
sussgoogle_4477-Oct-02 10:49 
GeneralRe: Displaying XML Pin
Christian Graus7-Oct-02 12:09
protectorChristian Graus7-Oct-02 12:09 
QuestionDoes PretranlateMsg have data in it to identify target? Pin
Anonymous7-Oct-02 10:28
Anonymous7-Oct-02 10:28 

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.