home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
gfx
/
edit
/
tsmorph
/
src
/
handlesettings.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-29
|
27KB
|
896 lines
// TSMorph - Amiga Morphing program
// Copyright (C) © 1993 Topicsave Limited
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// mpaddock@cix.compulink.co.uk
// include precompiled headers (if not already)
#ifndef TSMORPH_H
#include "TSMorph.h"
#endif
/* Remove menus from all windows allowing
* them to be updated
*/
void
RemoveMenus(void) {
if (TSMorphWnd) {
ClearMenuStrip(TSMorphWnd);
}
if (ControlWindow) {
ClearMenuStrip(Pic1.Win);
ClearMenuStrip(Pic2.Win);
ClearMenuStrip(ControlWindow);
}
}
/* Add the menus back again after
* calling RemoveMenus() and updating
*/
void
AddMenus(void) {
if (TSMorphWnd) {
ResetMenuStrip(TSMorphWnd,TSMorphMenus);
}
if (ControlWindow) {
ResetMenuStrip(ControlWindow,MyMenu);
ResetMenuStrip(Pic1.Win,MyMenu);
ResetMenuStrip(Pic2.Win,MyMenu);
}
}
/* Update the save format menu items
* Parameter: remove - set to TRUE to remove and add the menus
* to FALSE if menus have already been removed (for lots of updates)
*/
void
UpdateSaveFormat(BOOL remove) {
if (remove) {
RemoveMenus();
}
if (TSMorphWnd) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_ILBM24)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_OPAL24)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_OPAL24T)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_OPAL24F)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_OPAL24FT)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_JPEG)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_JPEGT)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_PBM)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_BW16)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_BW256)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_HAM6)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_HAM8)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_DCTV3)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,MI_DCTV4)))->Flags &= ~CHECKED;
}
if (ControlWindow) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_ILBM24)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_OPAL24)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_OPAL24T)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_OPAL24F)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_OPAL24FT)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_JPEG)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_JPEGT)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_PBM)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_BW16)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_BW256)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_HAM6)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_HAM8)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_DCTV3)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,MI_DCTV4)))->Flags &= ~CHECKED;
}
if (TSMorphWnd) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_SAVEFORMAT,SaveFormat)))->Flags |= CHECKED;
}
if (ControlWindow) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_SAVEFORMAT,SaveFormat)))->Flags |= CHECKED;
}
if (remove) {
AddMenus();
}
}
/* Update the render mode menu items
* see UpdateSaveFormat() for parameter
*/
void
UpdateRenderMode(BOOL remove) {
if (remove) {
RemoveMenus();
}
if (TSMorphWnd) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE1)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE2)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE4)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE8)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE16)))->Flags &= ~CHECKED;
}
if (ControlWindow) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE1)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE2)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE4)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE8)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE16)))->Flags &= ~CHECKED;
}
if (TSMorphWnd) {
if (RenderMode & 1) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE1)))->Flags |= CHECKED;
}
if (RenderMode & 2) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE2)))->Flags |= CHECKED;
}
if (RenderMode & 4) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE4)))->Flags |= CHECKED;
}
if (RenderMode & 8) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE8)))->Flags |= CHECKED;
}
if (RenderMode & 16) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_RENDERMODE,MI_MODE16)))->Flags |= CHECKED;
}
}
if (ControlWindow) {
if (RenderMode & 1) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE1)))->Flags |= CHECKED;
}
if (RenderMode & 2) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE2)))->Flags |= CHECKED;
}
if (RenderMode & 4) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE4)))->Flags |= CHECKED;
}
if (RenderMode & 8) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE8)))->Flags |= CHECKED;
}
if (RenderMode & 16) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_RENDERMODE,MI_MODE16)))->Flags |= CHECKED;
}
}
if (remove) {
AddMenus();
}
}
/* Update the open mode menu items
* see UpdateSaveFormat() for parameter
*/
void
UpdateOpenMode(BOOL remove) {
if (remove) {
RemoveMenus();
}
if (TSMorphWnd) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_OPENMODE,MI_ALWAYS)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_OPENMODE,MI_IFILBM)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_OPENMODE,MI_IFCOLOURS)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_OPENMODE,MI_REMAP)))->Flags &= ~CHECKED;
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_OPENMODE,MI_OPAL)))->Flags &= ~CHECKED;
}
if (ControlWindow) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_OPENMODE,MI_ALWAYS)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_OPENMODE,MI_IFILBM)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_OPENMODE,MI_IFCOLOURS)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_OPENMODE,MI_REMAP)))->Flags &= ~CHECKED;
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_OPENMODE,MI_OPAL)))->Flags &= ~CHECKED;
}
if (TSMorphWnd) {
(ItemAddress(TSMorphMenus,FULLMENUNUM(1,MM_OPENMODE,OpenMode)))->Flags |= CHECKED;
}
if (ControlWindow) {
(ItemAddress(MyMenu,FULLMENUNUM(M_SETTINGS,MM_OPENMODE,OpenMode)))->Flags |= CHECKE