Changeset 69 in Sophya


Ignore:
Timestamp:
Jan 26, 1998, 10:26:15 AM (28 years ago)
Author:
aubourg
Message:

Pour mac

Location:
trunk/SophyaPI/PI
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pibwdgmac.cc

    r66 r69  
    1212PIBaseWdgMac::PIBaseWdgMac(PIContainerGen *par, char *nom,
    1313                       int sx, int sy, int px, int py) :
    14 PIBaseWdgGen(par, nom, sx, sy, px, py)
     14PIBaseWdgGen(par, nom, sx, sy, px, py),
     15mFCol(PI_Black), mBCol(PI_White)
    1516{
    1617    mAdapter->AddAttachment(new PIUpdAttachment(this));
  • trunk/SophyaPI/PI/picmapmac.cc

    r64 r69  
    109109  mPalette = y->mPalette;
    110110  mCTab = y->mCTab;
     111  HandToHand(&(Handle)mCTab);
     112  HandToHand(&(Handle)mPalette);
    111113  Assert_(mPalette);
    112114}
  • trunk/SophyaPI/PI/pimenubarmac.cc

    r64 r69  
    11#include "pimenubarmac.h"
     2#include "pippmenubar.h"
    23#include <LMenuBar.h>
    34
     
    56:PIMenubarGen(par, nom)
    67{
     8        new PIPPMenuBar();
    79}
    810
  • trunk/SophyaPI/PI/pimenumac.cc

    r48 r69  
    4646{
    4747  LStr255 titre(nom);
    48  
     48  if (titre.BeginsWith("-",1))
     49    titre.Insert(" ", 1, 0);
     50  if (sc) {
     51    titre.Append('/');
     52    titre.Append(*sc);
     53  }
    4954  macMenu->InsertCommand(titre, -2000, 1000); // ou cmd_UseMenuItem ???
    5055  mMsgs.push_back(msg);
  • trunk/SophyaPI/PI/pimenumac.h

    r48 r69  
    4646        friend class    PIMenubarMac;
    4747        friend class    PIOptMenuMac;
     48        friend class    PIPPOptMenu;
    4849        friend class    PIPPMenuBar;
    4950        MenuHandle      GetMacMenuHandle();
  • trunk/SophyaPI/PI/pioptmenumac.cc

    r64 r69  
    11#include "pioptmenumac.h"
     2#include "pippoptmenu.h"
    23
    34/* --Methode-- */
     
    1617  int titleWidth = ::StringWidth(titre);
    1718 
    18   mPane = new LStdPopupMenu(mPaneInfo, msg_Click, 0, 200, titleWidth+5, popupMenuProc/*+popupVariableWidth*/, 130, titre, 0, 1);
     19  //mPane = new LStdPopupMenu(mPaneInfo, msg_Click, 0, 200, titleWidth+5, popupMenuProc/*+popupVariableWidth*/, 130, titre, 0, 1);
     20  mPane = new PIPPOptMenu(mPaneInfo, msg_Click, 0, 200, titleWidth+5, popupMenuProc/*+popupVariableWidth*/, 130, titre, 0, 1);
    1921  //macMenu = ((LStdPopupMenu*)mPane)->GetMacMenuH();
    2022 
    2123  // On va changer la resource de menu au passage...
    22   InsertMenu(pdm->GetMacMenuHandle(), hierMenu);
    23   PopupPrivateDataHandle        dataH =
    24                 (PopupPrivateDataHandle) (**((LStdPopupMenu*)mPane)->GetMacControl()).contrlData;
    25   (**dataH).mHandle = pdm->GetMacMenuHandle();
    26   (**dataH).mID = pdm->GetMacMenuID();
     24//  InsertMenu(pdm->GetMacMenuHandle(), hierMenu);
     25//  PopupPrivateDataHandle      dataH =
     26////            (PopupPrivateDataHandle) (**((LStdPopupMenu*)mPane)->GetMacControl()).contrlData;
     27//  (**dataH).mHandle = pdm->GetMacMenuHandle();
     28//  (**dataH).mID = pdm->GetMacMenuID();
    2729 
     30  ((PIPPOptMenu*)mPane)->SetMenu(pdm);
    2831  ((LStdPopupMenu*)mPane)->AddListener(this);
     32 
    2933  Manage();
    3034}
  • trunk/SophyaPI/PI/pippapplmac.cc

    r66 r69  
    3131PIPPApplMac::MakeMenuBar()
    3232{
    33         new PIPPMenuBar();
     33        //new PIPPMenuBar();
    3434}
    3535
  • trunk/SophyaPI/PI/pippmenubar.cc

    r6 r69  
    2626        return cmd_Nothing;
    2727}
     28
     29CommandT
     30PIPPMenuBar::FindKeyCommand(
     31        const EventRecord       &inKeyEvent,
     32        Int32                           &outMenuChoice) const
     33{
     34        char    theChar = inKeyEvent.message & charCodeMask;
     35        outMenuChoice = ::MenuKey(theChar);
     36        int menuId = HiWord(outMenuChoice);
     37        int menuItem = LoWord(outMenuChoice)-1; // Dans PI les menu items commencent a 0
     38       
     39        PIMenuMac* menu = PIMenuMac::findMenu(menuId);
     40        if (menu)
     41          menu->ItemSelected(menuItem);
     42       
     43        return cmd_Nothing;
     44}
  • trunk/SophyaPI/PI/pippmenubar.h

    r6 r69  
    1313                                                                Int32 &outMenuChoice) const;
    1414
     15        virtual CommandT        FindKeyCommand(
     16                                                                const EventRecord       &inKeyEvent,
     17                                                                Int32                           &outMenuChoice) const;
    1518};
    1619
  • trunk/SophyaPI/PI/pippwindowmac.cc

    r67 r69  
    99PIPPWindowMac::PIPPWindowMac()
    1010{
     11  myPIWindow = NULL;
    1112}
    1213
     
    2122:LWindow(inWindowInfo)
    2223{
     24  myPIWindow = NULL;
    2325}
    2426
     
    3638:LWindow(inWINDid, inAttributes, inSuperCommander)
    3739{
     40  myPIWindow = NULL;
    3841}
    3942
     
    5558inProcID, inAttributes, inBehind, inStorage)
    5659{
     60  myPIWindow = NULL;
    5761}
    5862
     
    6771:LWindow(inStream)
    6872{
     73  myPIWindow = NULL;
    6974}
    7075
     
    7681
    7782PIPPWindowMac::~PIPPWindowMac()
    78 {}
     83{
     84}
     85
     86void
     87PIPPWindowMac::AttemptClose()
     88{
     89  myPIWindow->Process(myPIWindow->BuildMsg(myPIWindow->Msg(),PIMsg_Close), myPIWindow, NULL) ;
     90}
     91
    7992
    8093const MessageT  msg_Resize                      = 817;
  • trunk/SophyaPI/PI/pippwindowmac.h

    r67 r69  
    11#include <LWindow.h>
     2#include "piwindowmac.h"
    23
    34class PIPPWindowMac : public LWindow {
     
    3031        virtual void            DoSetBounds(
    3132                                                                const Rect                      &inBounds);
     33                                                               
     34        virtual void            AttemptClose();
     35                                                               
     36        PIWindow* myPIWindow;
    3237};
  • trunk/SophyaPI/PI/piupdattachment.cc

    r66 r69  
    1414PIUpdAttachment::~PIUpdAttachment()
    1515{
    16  // SysBeep(1);
     16  if (lastCursPane == this) lastCursPane = NULL;
    1717}
    1818
     
    3030//        myWdg->Move();
    3131        break;
     32//      case cmd_Close: {
     33//        delete myWdg;
     34//        break;
     35//      }
    3236      case msg_Click: {
    3337        SMouseDownEvent* evt = (SMouseDownEvent*) data;
  • trunk/SophyaPI/PI/piwindowmac.cc

    r66 r69  
    11#include "piwindowmac.h"
     2#include "pippwindowmac.h"
    23
    34PIWindowMac::PIWindowMac(PIMsgHandler *par, char *nom, PIWindowKind k, int sx, int sy, int px, int py)
     
    4041        //mPane = new LWindow(mWindowInfo);
    4142        mPane = LWindow::CreateWindow(1000+k,LCommander::GetTopCommander());
     43    ((PIPPWindowMac*)mPane)->myPIWindow = this;
    4244        Rect r = {py, px, py+sy, px+sx};
    4345    ((LWindow*) mPane)->DoSetBounds(r);
Note: See TracChangeset for help on using the changeset viewer.