Files
source/Laptop/florist Order Form.cpp
T
Wanne 7ca53fadc7 *** MERGED source code from development trunk revision 4890 up to latest current revision 5105 ***
Development Trunk (now obsolete): https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP
A detailed list of all the features (changes) is visible in the history log of the development trunk:

INFO: There will be no further development in the development source trunk, so is obsolete from now on!

This commit contains the following features (bugfixes are not listed):

- New Feature: Show merc ranks in Strategy Screen before merc name
o Toggle on/off in the ingame options screen
o For each experience level (0-10) there are defined rank names in the language specific text files
o Additional language text that is not translated yet is marked with // TODO.Translate

- New Feature: Faster Bobby Ray Shipments
o This feature is selectable in the ja2_options.ini
o When activated Bobby Ray shipments will be really fast
-> Overnight Express: 5 - 7 hours
-> Air Service: 10, 12 or 14 hours
-> Standard Service: 15, 18 or 21 hours
o In a multiplayer game, this feature is disabled (because shipment arrive immediately in the destination sector)

- New Feature: AP cost for manipulating the merc inventory
o This feature is selectable in the start new game screen
o For example, putting a weapon from hand in the backpack costs APs
o The AP costs are defined in the APBPConstants.ini
o In a multiplayer game, this feature is disabled

- New Feature: Added possibility to set individual Gear Kit names
o Set individual names in the optional new tag <mGearKitName> inside the <GEARKIT> root element (File: TableData\MercStartingGear.xml)

- New Feature: Externalized the maximum purchase amount (JA2 vanilla: 10) for Bobby Rays purchases per shipment
o Define the max. amount in the ja2_options.ini: BOBBY_RAY_MAX_PURCHASE_AMOUNT, Range: 10 - 100)
o Nice scrolling bars to scroll through all the purchases

- New Feature: Now it is possible to walk on "water" tiles or handle those tiles like "normal" tiles 
o (instead of showing the swimming animation and counting the APs for swimming), when the soldier is located on the second level (level > 0)

- New Feature: Externalized AIM Veterans laptop site
o Add maximum of 4 pages
o Add  new AIM to veterans page, and remove AIM from veterans page.
o New XML file: OldAIMArchive.xml (language specific XML files: *.OldAIMArchive.xml)

- New Feature: Added possibility to choose from 254 IMP faces
o Modified IMPPortraits.xml
o Added new GameDir folder "IMPFaces" which contains the IMP face portraits
o Moved IMP faces in the new "IMPFaces" folder

- New Feature: ARSP - All Resolution Support Project
o See here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298698&page=1
o Support any kind of screen resolution. This works by choosing the matching full supported resolution (640x480, 800x600, 1024x768) and then centering the graphics
o See ja2.ini for defining the screen resolution

- New Feature: AI Turn Speed Up (FF-MOD)
o see here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298699#Post298699
o When this feature is activated it allows fast enemy turns
o New entry in ja2.ini to enable this feature: HIGHSPEED_TIMER = TRUE
o Turn on/off auto fast turns in ingame options
o New ja2_options.ini settings for fine tuning: [Clock Settings] ini block

- New Feature: "Lock" / "Release" mouse cursor in tactical windowed mode, so the mouse can stay within window boundary
o This is very helpful for doing scrolling with the mouse (by moving the mouse to the window edge) in windowed mode
o You can toggle on/off the feature by pressing CTRL + Z. It is also possible to press CTRL + Y. So the user can decide which fits better :)
o Whenever you toggle on/off a screen message appears on the tactical log to notify the player

- New Feature: Weapon overheating
o Basically, every shot fired from a gun increases its temperature. On higher temperatures, the gun jams more frequently
o On/off toggle in the ingame options
o Graphical thermometer indication on the weapon picture
o New ja2_options.ini section with a few options, Section: [Tactical Weapon Overheating Settings]
o XML changes (New Tags)
--> AmmoTypes.xml: <temperatureModificator>
--> Items.xml: <barrel>, <usOverheatingCooldownFactor>
--> Weapons.xml: <usOverheatingJamThreshold>, <usOverheatingDamageThreshold>, <usOverheatingSingleShotTemperature>
o Added a few barells to Items.xml (end of the file)
o more infos: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=301059&page=1

- New Feature: Resting weapons on a surfaces
o You can now rest your weapon on crates, low walls, rocks, debris, open windows etc. while you are crouched. Resting will give yu the superior gun handling modifiers from PRONE position.
o A little 'A' on your gun indicates if you are resting it or not.
o Both settings can be turned on and off in Ja2_Options.ini under 'Tactical Gameplay Settings'

- New Feature: Externalized option on whether mercs can exit sector using grid exit in turn based mode
o new ja2_options.ini property: GRID_EXIT_IN_TURNBASED
o This ini setting does not affect leaving sectors on map edges

- Rework/Update: Ammo boxes and Ammo crates
o Ammo crate items added for remaining calibers.  Tweaked prices to correspond to magazines, tweaked capacities and weights to be reasonable (~800 or less).
o Shift-R reload now looks at both boxes and crates in sector items and merc's inventory to reload, and tops off magazines in inventory as well.  Only possible outside of combat.
o Ctrl-Shift-A still creates crates as per usual, with some fixes to ensure all ammo is caught on the first press.
o Shift-A now creates ammo boxes in the same loop.  They mostly behave like crates, but fit in mercs inventories.
o Ammo boxes are available to purchase at BR and tony, sam, etc.  Individual magazines/drums/etc are no longer available.
o Removed ammo crate xml tag.  Added ubMagType tag to Magazines array.  This allows us to differentiate between magazines, bullets, boxes and crates.
o Changed ammo filtering in BR's to display boxes appropriately.  Added back the "Mag:" display (changed text to "Size:")
o Added ja2set.dat.xml file (WF map version in WF maps folder) to be used instead of ja2set.dat file (ja2.ini setting added) For now, if you want to play vanilla instead, just change the setting in the ini (see comments in file).
o Added P4-P9Items image files (up to 5k images each) and tileslots.  1.13 core items will continue to use Guns and P1-P3Items for the foreseeable future.  P4-P9 can be used by customizers/modders to avoid conflicts with Guns/P1-P3 items.  TODO: Need to discuss a strategy for this in the forums.
o Added in Ambient/0.bad and 32.bad to avoid an exception in the code.
o Updated the XML Editor
o Standardized the text on all the ammo items.

- New Multiplayer Feature: Sharing same FOV (field of view) in a coop/team-dm (for friendly teams) game
o You will also see enemies, that your teammate sees

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5108 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2012-03-23 18:46:54 +00:00

1329 lines
53 KiB
C++

#ifdef PRECOMPILEDHEADERS
#include "Laptop All.h"
#else
#include "laptop.h"
#include "florist.h"
#include "florist Order Form.h"
#include "WCheck.h"
#include "Utilities.h"
#include "WordWrap.h"
#include "Cursors.h"
#include "florist Gallery.h"
#include "stdio.h"
#include "Encrypted File.h"
#include "florist Cards.h"
#include "Text Input.h"
#include "Finances.h"
#include "Game clock.h"
#include "english.h"
#include "Text.h"
#include "LaptopSave.h"
#include "Random.h"
#endif
#include "meanwhile.h"
#define FLOWER_ORDEER_TINY_FONT FONT10ARIAL
#define FLOWER_ORDEER_SMALL_FONT FONT12ARIAL
#define FLOWER_ORDEER_BIG_FONT FONT12ARIAL
#define FLOWER_ORDEER_SMALL_COLOR FONT_MCOLOR_WHITE
#define FLOWER_ORDEER_LINK_COLOR FONT_MCOLOR_LTYELLOW
#define FLOWER_ORDEER_DROP_DOWN_FONT FONT12ARIAL
#define FLOWER_ORDEER_DROP_DOWN_COLOR FONT_MCOLOR_WHITE
#define FLOWER_ORDER_STATIC_TEXT_COLOR 76
#define FLOWER_ORDER_FLOWER_BOX_X LAPTOP_SCREEN_UL_X + 7
#define FLOWER_ORDER_FLOWER_BOX_Y LAPTOP_SCREEN_WEB_UL_Y + 63
#define FLOWER_ORDER_FLOWER_BOX_WIDTH 75
#define FLOWER_ORDER_FLOWER_BOX_HEIGHT 100
#define FLOWER_ORDER_SENTIMENT_BOX_X LAPTOP_SCREEN_UL_X + 14
#define FLOWER_ORDER_SENTIMENT_BOX_Y LAPTOP_SCREEN_WEB_UL_Y + 226
#define FLOWER_ORDER_SENTIMENT_BOX_WIDTH 468
#define FLOWER_ORDER_SENTIMENT_BOX_HEIGHT 27
#define FLOWER_ORDER_NAME_BOX_X LAPTOP_SCREEN_UL_X + 60
#define FLOWER_ORDER_NAME_BOX_Y LAPTOP_SCREEN_WEB_UL_Y + 314 - FLOWER_ORDER_SMALLER_PS_OFFSET_Y
#define FLOWER_ORDER_SMALLER_PS_OFFSET_Y 27
#define FLOWER_ORDER_DELIVERY_LOCATION_X LAPTOP_SCREEN_UL_X + 205
#define FLOWER_ORDER_DELIVERY_LOCATION_Y LAPTOP_SCREEN_WEB_UL_Y + 143
#define FLOWER_ORDER_DELIVERY_LOCATION_WIDTH 252
#define FLOWER_ORDER_DELIVERY_LOCATION_HEIGHT 20
#define FLOWER_ORDER_BACK_BUTTON_X LAPTOP_SCREEN_UL_X + 8
#define FLOWER_ORDER_BACK_BUTTON_Y LAPTOP_SCREEN_WEB_UL_Y + 12
#define FLOWER_ORDER_SEND_BUTTON_X LAPTOP_SCREEN_UL_X + 124
#define FLOWER_ORDER_SEND_BUTTON_Y LAPTOP_SCREEN_WEB_UL_Y + 364
#define FLOWER_ORDER_CLEAR_BUTTON_X LAPTOP_SCREEN_UL_X + 215
#define FLOWER_ORDER_CLEAR_BUTTON_Y FLOWER_ORDER_SEND_BUTTON_Y
#define FLOWER_ORDER_GALLERY_BUTTON_X LAPTOP_SCREEN_UL_X + 305
#define FLOWER_ORDER_GALLERY_BUTTON_Y FLOWER_ORDER_SEND_BUTTON_Y
#define FLOWER_ORDER_FLOWER_NAME_X LAPTOP_SCREEN_UL_X + 94
#define FLOWER_ORDER_FLOWER_NAME_Y LAPTOP_SCREEN_WEB_UL_Y + 68
#define FLOWER_ORDER_BOUQUET_NAME_X FLOWER_ORDER_FLOWER_NAME_X
#define FLOWER_ORDER_BOUQUET_NAME_Y FLOWER_ORDER_ORDER_NUM_NAME_Y + 15//FLOWER_ORDER_FLOWER_NAME_Y + 15
#define FLOWER_ORDER_ORDER_NUM_NAME_X FLOWER_ORDER_BOUQUET_NAME_X
#define FLOWER_ORDER_ORDER_NUM_NAME_Y FLOWER_ORDER_FLOWER_NAME_Y + 15//FLOWER_ORDER_BOUQUET_NAME_Y + 15
#define FLOWER_ORDER_DATE_X FLOWER_ORDER_FLOWER_NAME_X
#define FLOWER_ORDER_DATE_Y LAPTOP_SCREEN_WEB_UL_Y + 126
#define FLOWER_ORDER_LOCATION_X FLOWER_ORDER_FLOWER_NAME_X
#define FLOWER_ORDER_LOCATION_Y FLOWER_ORDER_DELIVERY_LOCATION_Y + 4
#define FLOWER_ORDER_ADDITIONAL_SERVICES_X FLOWER_ORDER_FLOWER_BOX_X
#define FLOWER_ORDER_ADDITIONAL_SERVICES_Y LAPTOP_SCREEN_WEB_UL_Y + 167
#define FLOWER_ORDER_PERSONAL_SENT_TEXT_X FLOWER_ORDER_ADDITIONAL_SERVICES_X
#define FLOWER_ORDER_PERSONAL_SENT_TEXT_Y LAPTOP_SCREEN_WEB_UL_Y + 212
#define FLOWER_ORDER_PERSONAL_SENT_BOX_X FLOWER_ORDER_SENTIMENT_BOX_X + 5
#define FLOWER_ORDER_PERSONAL_SENT_BOX_Y FLOWER_ORDER_SENTIMENT_BOX_Y + 5
#define FLOWER_ORDER_PERSONAL_SENT_TEXT_WIDTH 457
#define FLOWER_ORDER_PERSONAL_SENT_TEXT_HEIGHT 17//44
#define FLOWER_ORDER_BILLING_INFO_X FLOWER_ORDER_ADDITIONAL_SERVICES_X
#define FLOWER_ORDER_BILLING_INFO_Y LAPTOP_SCREEN_WEB_UL_Y + 296 - FLOWER_ORDER_SMALLER_PS_OFFSET_Y
#define FLOWER_ORDER_NAME_TEXT_X FLOWER_ORDER_ADDITIONAL_SERVICES_X
#define FLOWER_ORDER_NAME_TEXT_Y FLOWER_ORDER_NAME_BOX_Y+4
#define FLOWER_ORDER_NAME_TEXT_WIDTH 50
#define FLOWER_ORDER_NAME_TEXT_BOX_X FLOWER_ORDER_NAME_BOX_X + 3
#define FLOWER_ORDER_NAME_TEXT_BOX_Y FLOWER_ORDER_NAME_BOX_Y + 3
#define FLOWER_ORDER_NAME_TEXT_BOX_WIDTH 257
#define FLOWER_ORDER_NAME_TEXT_BOX_HEIGHT 15
#define FLOWER_ORDER_CHECK_WIDTH 20
#define FLOWER_ORDER_CHECK_HEIGHT 17
#define FLOWER_ORDER_CHECK_BOX_0_X LAPTOP_SCREEN_UL_X + 186
#define FLOWER_ORDER_CHECK_BOX_0_Y FLOWER_ORDER_DATE_Y - 3
#define FLOWER_ORDER_CHECK_BOX_1_X LAPTOP_SCREEN_UL_X + 270
#define FLOWER_ORDER_CHECK_BOX_1_Y FLOWER_ORDER_CHECK_BOX_0_Y
#define FLOWER_ORDER_CHECK_BOX_2_X LAPTOP_SCREEN_UL_X + 123
#define FLOWER_ORDER_CHECK_BOX_2_Y FLOWER_ORDER_ADDITIONAL_SERVICES_Y
#define FLOWER_ORDER_CHECK_BOX_3_X LAPTOP_SCREEN_UL_X + 269
#define FLOWER_ORDER_CHECK_BOX_3_Y FLOWER_ORDER_CHECK_BOX_2_Y
#define FLOWER_ORDER_CHECK_BOX_4_X FLOWER_ORDER_CHECK_BOX_2_X
#define FLOWER_ORDER_CHECK_BOX_4_Y FLOWER_ORDER_CHECK_BOX_2_Y + 25
#define FLOWER_ORDER_CHECK_BOX_5_X FLOWER_ORDER_CHECK_BOX_3_X
#define FLOWER_ORDER_CHECK_BOX_5_Y FLOWER_ORDER_CHECK_BOX_4_Y
#define FLOWER_ORDER_LINK_TO_CARD_GALLERY_X LAPTOP_SCREEN_UL_X + 190
#define FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y LAPTOP_SCREEN_WEB_UL_Y + 284 - FLOWER_ORDER_SMALLER_PS_OFFSET_Y
#define FLOWER_ORDER_DROP_DOWN_LOCATION_X FLOWER_ORDER_DELIVERY_LOCATION_X
#define FLOWER_ORDER_DROP_DOWN_LOCATION_Y FLOWER_ORDER_DELIVERY_LOCATION_Y + 19
#define FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH 230
#define FLOWER_ORDER_DROP_DOWN_CITY_START_X FLOWER_ORDER_DROP_DOWN_LOCATION_X + 5
#define FLOWER_ORDER_DROP_DOWN_CITY_START_Y FLOWER_ORDER_DROP_DOWN_LOCATION_Y + 3
#define FLOWER_ORDER_PERSONEL_SENTIMENT_NUM_CHARS 75
#define FLOWER_ORDER_NAME_FIELD_NUM_CHARS 35
typedef struct
{
STR16 *psCityLoc;
UINT8 ubNextDayDeliveryCost;
UINT8 ubWhenItGetsThereCost;
} FlowerOrderLocationStruct;
#define FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS 17
FlowerOrderLocationStruct FlowerOrderLocations[FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS]={
{ &pDeliveryLocationStrings[0], 20, 15},
{ &pDeliveryLocationStrings[1], 95, 70},
{ &pDeliveryLocationStrings[2], 100, 75},
{ &pDeliveryLocationStrings[3], 50, 35},
{ &pDeliveryLocationStrings[4], 70, 50},
{ &pDeliveryLocationStrings[5], 45, 35},
{ &pDeliveryLocationStrings[6], 30, 25},
{ &pDeliveryLocationStrings[7], 100, 75},
{ &pDeliveryLocationStrings[8], 100, 75},
{ &pDeliveryLocationStrings[9], 30, 25},
{ &pDeliveryLocationStrings[10], 95, 70},
{ &pDeliveryLocationStrings[11], 30, 25},
{ &pDeliveryLocationStrings[12], 40, 30},
{ &pDeliveryLocationStrings[13], 45, 35},
{ &pDeliveryLocationStrings[14], 95, 70},
{ &pDeliveryLocationStrings[15], 50, 40},
{ &pDeliveryLocationStrings[16], 40, 30}
};
UINT32 guiDeliveryLocation;
UINT32 guiFlowerFrame;
UINT32 guiCurrentlySelectedFlowerImage;
UINT32 guiNameBox;
UINT32 guiPersonalSentiments;
UINT32 guiFlowerOrderCheckBoxButtonImage;
extern UINT32 guiDropDownBorder; // symbol already defined in BobbyRMailOrder.cpp (jonathanl)
BOOLEAN gfFLoristCheckBox0Down = FALSE; // next day delviery
BOOLEAN gfFLoristCheckBox1Down = TRUE; // when it gets there delivery
BOOLEAN gfFLoristCheckBox2Down = FALSE;
BOOLEAN gfFLoristCheckBox3Down = FALSE;
BOOLEAN gfFLoristCheckBox4Down = FALSE;
BOOLEAN gfFLoristCheckBox5Down = FALSE;
UINT32 guiFlowerPrice;
//drop down menu
enum
{
FLOWER_ORDER_DROP_DOWN_NO_ACTION,
FLOWER_ORDER_DROP_DOWN_CREATE,
FLOWER_ORDER_DROP_DOWN_DESTROY,
FLOWER_ORDER_DROP_DOWN_DISPLAY,
};
//the current mode of the drop down display
UINT8 gubFlowerDestDropDownMode;
UINT8 gubCurrentlySelectedFlowerLocation;
CHAR16 gsSentimentTextField[ FLOWER_ORDER_PERSONEL_SENTIMENT_NUM_CHARS ] = {0} ;
CHAR16 gsNameTextField[ FLOWER_ORDER_NAME_FIELD_NUM_CHARS ] = {0};
//buttons
INT32 guiFlowerOrderButtonImage;
UINT8 gubFlowerOrder_AdditioanalServicePrices[] = {10, 20, 10, 10};
void BtnFlowerOrderBackButtonCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiFlowerOrderBackButton;
void BtnFlowerOrderSendButtonCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiFlowerOrderSendButton;
void BtnFlowerOrderClearButtonCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiFlowerOrderClearButton;
void BtnFlowerOrderGalleryButtonCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiFlowerOrderGalleryButton;
//Clicking on OrderCheckBox
MOUSE_REGION gSelectedFloristCheckBoxRegion[ 6 ];
void SelectFlorsitCheckBoxRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
//link to the card gallery
MOUSE_REGION gSelectedFloristCardGalleryLinkRegion;
void SelectFloristCardGalleryLinkRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
//link to the flower gallery by clicking on the flower
MOUSE_REGION gSelectedFloristGalleryLinkRegion;
void SelectFloristGalleryLinkRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
//the drop down for the city
MOUSE_REGION gSelectedFloristDropDownRegion;
void SelectFloristDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
//to disable the drop down window
MOUSE_REGION gSelectedFloristDisableDropDownRegion;
void SelectFloristDisableDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
//mouse region for the drop down city location area
MOUSE_REGION gSelectedFlowerDropDownRegion[ FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS ];
void SelectFlowerDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectFlowerDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason );
//to select typing in the personal sentiment box
//MOUSE_REGION gSelectedFloristPersonalSentimentBoxRegion;
//void SelectFloristPersonalSentimentBoxRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void DisplayFloristCheckBox();
void DisplayFlowerDynamicItems();
BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode );
void FlowerOrderDrawSelectedCity( UINT8 ubNumber );
void FlowerOrderDisplayShippingLocationCity();
void InitFlowerOrderTextInputBoxes();
void DestroyFlowerOrderTextInputBoxes();
void HandleFloristOrderKeyBoardInput();
void FlowerOrderUserTextFieldCallBack( UINT8 ubID, BOOLEAN fEntering);
void GameInitFloristOrderForm()
{
}
BOOLEAN EnterFloristOrderForm()
{
VOBJECT_DESC VObjectDesc;
UINT8 i;
char sTemp[40];
UINT16 usPosX, usWidth, usHeight;
InitFloristDefaults();
// load the DeliveryLocation graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\DeliveryLocation.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiDeliveryLocation));
// load the Flower frame graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\FlowerFrame.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiFlowerFrame));
// load the Personel sentiments graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\PersonalSentiments.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiPersonalSentiments));
// load the Name Box graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\NameBox.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiNameBox));
// load the Check Box graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\OrderCheckBox.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiFlowerOrderCheckBoxButtonImage));
// load the currently selected flower bouquet
sprintf( sTemp, "LAPTOP\\Flower_%d.sti", guiCurrentlySelectedFlower);
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP( sTemp, VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiCurrentlySelectedFlowerImage));
// border
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP( "INTERFACE\\TactPopUp.sti", VObjectDesc.ImageFile );
CHECKF( AddVideoObject( &VObjectDesc, &guiDropDownBorder ) );
guiFlowerOrderButtonImage = LoadButtonImage("LAPTOP\\FloristButtons.sti", -1,0,-1,1,-1 );
guiFlowerOrderBackButton = CreateIconAndTextButton( guiFlowerOrderButtonImage, sOrderFormText[FLORIST_ORDER_BACK], FLORIST_BUTTON_TEXT_FONT,
FLORIST_BUTTON_TEXT_UP_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
FLORIST_BUTTON_TEXT_DOWN_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
TEXT_CJUSTIFIED,
FLOWER_ORDER_BACK_BUTTON_X, FLOWER_ORDER_BACK_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnFlowerOrderBackButtonCallback);
SetButtonCursor(guiFlowerOrderBackButton, CURSOR_WWW );
guiFlowerOrderSendButton = CreateIconAndTextButton( guiFlowerOrderButtonImage, sOrderFormText[FLORIST_ORDER_SEND], FLORIST_BUTTON_TEXT_FONT,
FLORIST_BUTTON_TEXT_UP_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
FLORIST_BUTTON_TEXT_DOWN_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
TEXT_CJUSTIFIED,
FLOWER_ORDER_SEND_BUTTON_X, FLOWER_ORDER_SEND_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnFlowerOrderSendButtonCallback);
SetButtonCursor(guiFlowerOrderSendButton, CURSOR_WWW );
guiFlowerOrderClearButton = CreateIconAndTextButton( guiFlowerOrderButtonImage, sOrderFormText[FLORIST_ORDER_CLEAR], FLORIST_BUTTON_TEXT_FONT,
FLORIST_BUTTON_TEXT_UP_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
FLORIST_BUTTON_TEXT_DOWN_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
TEXT_CJUSTIFIED,
FLOWER_ORDER_CLEAR_BUTTON_X, FLOWER_ORDER_CLEAR_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnFlowerOrderClearButtonCallback);
SetButtonCursor(guiFlowerOrderClearButton, CURSOR_WWW );
guiFlowerOrderGalleryButton = CreateIconAndTextButton( guiFlowerOrderButtonImage, sOrderFormText[FLORIST_ORDER_GALLERY], FLORIST_BUTTON_TEXT_FONT,
FLORIST_BUTTON_TEXT_UP_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
FLORIST_BUTTON_TEXT_DOWN_COLOR, FLORIST_BUTTON_TEXT_SHADOW_COLOR,
TEXT_CJUSTIFIED,
FLOWER_ORDER_GALLERY_BUTTON_X, FLOWER_ORDER_GALLERY_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnFlowerOrderGalleryButtonCallback);
SetButtonCursor(guiFlowerOrderGalleryButton, CURSOR_WWW );
//
// The check box mouse regions
//
i=0;
MSYS_DefineRegion( &gSelectedFloristCheckBoxRegion[i], FLOWER_ORDER_CHECK_BOX_0_X, FLOWER_ORDER_CHECK_BOX_0_Y, (UINT16)(FLOWER_ORDER_CHECK_BOX_0_X + FLOWER_ORDER_CHECK_WIDTH), (UINT16)(FLOWER_ORDER_CHECK_BOX_0_Y + FLOWER_ORDER_CHECK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFlorsitCheckBoxRegionCallBack );
MSYS_AddRegion(&gSelectedFloristCheckBoxRegion[i]);
MSYS_SetRegionUserData( &gSelectedFloristCheckBoxRegion[i], 0, i );
i++;
MSYS_DefineRegion( &gSelectedFloristCheckBoxRegion[i], FLOWER_ORDER_CHECK_BOX_1_X, FLOWER_ORDER_CHECK_BOX_1_Y, (UINT16)(FLOWER_ORDER_CHECK_BOX_1_X + FLOWER_ORDER_CHECK_WIDTH), (UINT16)(FLOWER_ORDER_CHECK_BOX_1_Y + FLOWER_ORDER_CHECK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFlorsitCheckBoxRegionCallBack );
MSYS_AddRegion(&gSelectedFloristCheckBoxRegion[i]);
MSYS_SetRegionUserData( &gSelectedFloristCheckBoxRegion[i], 0, i );
i++;
MSYS_DefineRegion( &gSelectedFloristCheckBoxRegion[i], FLOWER_ORDER_CHECK_BOX_2_X, FLOWER_ORDER_CHECK_BOX_2_Y, (UINT16)(FLOWER_ORDER_CHECK_BOX_2_X + FLOWER_ORDER_CHECK_WIDTH), (UINT16)(FLOWER_ORDER_CHECK_BOX_2_Y + FLOWER_ORDER_CHECK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFlorsitCheckBoxRegionCallBack );
MSYS_AddRegion(&gSelectedFloristCheckBoxRegion[i]);
MSYS_SetRegionUserData( &gSelectedFloristCheckBoxRegion[i], 0, i );
i++;
MSYS_DefineRegion( &gSelectedFloristCheckBoxRegion[i], FLOWER_ORDER_CHECK_BOX_3_X, FLOWER_ORDER_CHECK_BOX_3_Y, (UINT16)(FLOWER_ORDER_CHECK_BOX_3_X + FLOWER_ORDER_CHECK_WIDTH), (UINT16)(FLOWER_ORDER_CHECK_BOX_3_Y + FLOWER_ORDER_CHECK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFlorsitCheckBoxRegionCallBack );
MSYS_AddRegion(&gSelectedFloristCheckBoxRegion[i]);
MSYS_SetRegionUserData( &gSelectedFloristCheckBoxRegion[i], 0, i );
i++;
MSYS_DefineRegion( &gSelectedFloristCheckBoxRegion[i], FLOWER_ORDER_CHECK_BOX_4_X, FLOWER_ORDER_CHECK_BOX_4_Y, (UINT16)(FLOWER_ORDER_CHECK_BOX_4_X + FLOWER_ORDER_CHECK_WIDTH), (UINT16)(FLOWER_ORDER_CHECK_BOX_4_Y + FLOWER_ORDER_CHECK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFlorsitCheckBoxRegionCallBack );
MSYS_AddRegion(&gSelectedFloristCheckBoxRegion[i]);
MSYS_SetRegionUserData( &gSelectedFloristCheckBoxRegion[i], 0, i );
i++;
MSYS_DefineRegion( &gSelectedFloristCheckBoxRegion[i], FLOWER_ORDER_CHECK_BOX_5_X, FLOWER_ORDER_CHECK_BOX_5_Y, (UINT16)(FLOWER_ORDER_CHECK_BOX_5_X + FLOWER_ORDER_CHECK_WIDTH), (UINT16)(FLOWER_ORDER_CHECK_BOX_5_Y + FLOWER_ORDER_CHECK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFlorsitCheckBoxRegionCallBack );
MSYS_AddRegion(&gSelectedFloristCheckBoxRegion[i]);
MSYS_SetRegionUserData( &gSelectedFloristCheckBoxRegion[i], 0, i );
i++;
usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDEER_SMALL_FONT) + 2 + FLOWER_ORDER_LINK_TO_CARD_GALLERY_X;
usWidth = StringPixLength( sOrderFormText[FLORIST_ORDER_STANDARDIZED_CARDS], FLOWER_ORDEER_SMALL_FONT);
usHeight = GetFontHeight(FLOWER_ORDEER_SMALL_FONT);
MSYS_DefineRegion( &gSelectedFloristCardGalleryLinkRegion, usPosX, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, (UINT16)(usPosX + usWidth), (UINT16)(FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y + usHeight), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFloristCardGalleryLinkRegionCallBack );
MSYS_AddRegion(&gSelectedFloristCardGalleryLinkRegion);
//flower link
MSYS_DefineRegion( &gSelectedFloristGalleryLinkRegion, FLOWER_ORDER_FLOWER_BOX_X, FLOWER_ORDER_FLOWER_BOX_Y, (UINT16)(FLOWER_ORDER_FLOWER_BOX_X + FLOWER_ORDER_FLOWER_BOX_WIDTH), (UINT16)(FLOWER_ORDER_FLOWER_BOX_Y + FLOWER_ORDER_FLOWER_BOX_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFloristGalleryLinkRegionCallBack );
MSYS_AddRegion(&gSelectedFloristGalleryLinkRegion);
//drop down city location
MSYS_DefineRegion( &gSelectedFloristDropDownRegion, FLOWER_ORDER_DELIVERY_LOCATION_X, FLOWER_ORDER_DELIVERY_LOCATION_Y, (UINT16)(FLOWER_ORDER_DELIVERY_LOCATION_X + FLOWER_ORDER_DELIVERY_LOCATION_WIDTH), (UINT16)(FLOWER_ORDER_DELIVERY_LOCATION_Y + FLOWER_ORDER_DELIVERY_LOCATION_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectFloristDropDownRegionCallBack);
MSYS_AddRegion(&gSelectedFloristDropDownRegion);
//to disable the drop down city location
MSYS_DefineRegion( &gSelectedFloristDisableDropDownRegion, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y, LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y, MSYS_PRIORITY_HIGH+2,
CURSOR_LAPTOP_SCREEN, MSYS_NO_CALLBACK, SelectFloristDisableDropDownRegionCallBack);
MSYS_AddRegion(&gSelectedFloristDisableDropDownRegion);
MSYS_DisableRegion(&gSelectedFloristDisableDropDownRegion);
//to select typing in the personal sentiment box
// MSYS_DefineRegion( &gSelectedFloristPersonalSentimentBoxRegion, FLOWER_ORDER_SENTIMENT_BOX_X, FLOWER_ORDER_SENTIMENT_BOX_Y, (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_X + FLOWER_ORDER_SENTIMENT_BOX_WIDTH), (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_Y + FLOWER_ORDER_SENTIMENT_BOX_HEIGHT), MSYS_PRIORITY_HIGH,
// CURSOR_WWW, MSYS_NO_CALLBACK, SelectFloristPersonalSentimentBoxRegionCallBack);
// MSYS_AddRegion( &gSelectedFloristPersonalSentimentBoxRegion );
InitFlowerOrderTextInputBoxes();
LaptopSaveInfo.uiFlowerOrderNumber += Random( 5 ) + 1;
RenderFloristOrderForm();
// guiFlowerPrice = 0;
// gubFlowerDestDropDownMode = FLOWER_ORDER_DROP_DOWN_NO_ACTION;
// gubCurrentlySelectedFlowerLocation = 0;
return(TRUE);
}
void InitFloristOrderFormVariables()
{
guiFlowerPrice = 0;
gubFlowerDestDropDownMode = FLOWER_ORDER_DROP_DOWN_NO_ACTION;
gubCurrentlySelectedFlowerLocation = 0;
}
void ExitFloristOrderForm()
{
UINT8 i;
RemoveFloristDefaults();
DeleteVideoObjectFromIndex( guiDeliveryLocation );
DeleteVideoObjectFromIndex( guiFlowerFrame );
DeleteVideoObjectFromIndex( guiNameBox );
DeleteVideoObjectFromIndex( guiPersonalSentiments );
DeleteVideoObjectFromIndex( guiFlowerOrderCheckBoxButtonImage );
DeleteVideoObjectFromIndex( guiCurrentlySelectedFlowerImage );
DeleteVideoObjectFromIndex(guiDropDownBorder);
for(i=0; i<6; i++)
MSYS_RemoveRegion( &gSelectedFloristCheckBoxRegion[i]);
//card gallery link
MSYS_RemoveRegion( &gSelectedFloristCardGalleryLinkRegion);
//flower link
MSYS_RemoveRegion( &gSelectedFloristGalleryLinkRegion);
//flower link
MSYS_RemoveRegion( &gSelectedFloristDropDownRegion);
//to select typing in the personal sentiment box
// MSYS_RemoveRegion( &gSelectedFloristPersonalSentimentBoxRegion);
//disable the drop down window
MSYS_RemoveRegion( &gSelectedFloristDisableDropDownRegion);
UnloadButtonImage( guiFlowerOrderButtonImage );
RemoveButton( guiFlowerOrderBackButton );
RemoveButton( guiFlowerOrderSendButton );
RemoveButton( guiFlowerOrderClearButton );
RemoveButton( guiFlowerOrderGalleryButton );
//Store the text fields
Get16BitStringFromField( 1, gsSentimentTextField, 75 );
Get16BitStringFromField( 2, gsNameTextField, 35 );
gbCurrentlySelectedCard = -1;
DestroyFlowerOrderTextInputBoxes();
}
void HandleFloristOrderForm()
{
if( gubFlowerDestDropDownMode != FLOWER_ORDER_DROP_DOWN_NO_ACTION )
{
CreateDestroyFlowerOrderDestDropDown( gubFlowerDestDropDownMode );
}
HandleFloristOrderKeyBoardInput();
RenderAllTextFields();
}
void RenderFloristOrderForm()
{
HVOBJECT hPixHandle;
UINT16 usPosX;
CHAR16 sTemp[ 640 ];
UINT32 uiStartLoc=0;
DisplayFloristDefaults();
//The flowe Delivery location
GetVideoObject(&hPixHandle, guiDeliveryLocation);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0,FLOWER_ORDER_DELIVERY_LOCATION_X, FLOWER_ORDER_DELIVERY_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//The flowe Flower Frame
GetVideoObject(&hPixHandle, guiFlowerFrame);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0,FLOWER_ORDER_FLOWER_BOX_X, FLOWER_ORDER_FLOWER_BOX_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//The currenltly selected flwoer
GetVideoObject(&hPixHandle, guiCurrentlySelectedFlowerImage);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0,FLOWER_ORDER_FLOWER_BOX_X+5, FLOWER_ORDER_FLOWER_BOX_Y+5, VO_BLT_SRCTRANSPARENCY,NULL);
//The flowe Name Box
GetVideoObject(&hPixHandle, guiNameBox);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0,FLOWER_ORDER_NAME_BOX_X, FLOWER_ORDER_NAME_BOX_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//The flowe Personel sentiments
GetVideoObject(&hPixHandle, guiPersonalSentiments);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0,FLOWER_ORDER_SENTIMENT_BOX_X, FLOWER_ORDER_SENTIMENT_BOX_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//Bouquet name, price and order number,text
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NAME_BOUQUET], FLOWER_ORDER_FLOWER_NAME_X, FLOWER_ORDER_FLOWER_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_PRICE], FLOWER_ORDER_BOUQUET_NAME_X, FLOWER_ORDER_BOUQUET_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_ORDER_NUMBER], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_ORDER_NUM_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//The flower name
usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_NAME_BOUQUET], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_FLOWER_NAME_X;
uiStartLoc = FLOR_GALLERY_TEXT_TOTAL_SIZE * guiCurrentlySelectedFlower;
LoadEncryptedDataFromFile(FLOR_GALLERY_TEXT_FILE, sTemp, uiStartLoc, FLOR_GALLERY_TEXT_TITLE_SIZE);
DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_FLOWER_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//Deliverry Date
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_DELIVERY_DATE], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_DATE_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//Next day
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NEXT_DAY], FLOWER_ORDER_CHECK_BOX_0_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_0_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//When it get there
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_GETS_THERE], FLOWER_ORDER_CHECK_BOX_1_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_1_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//Deliverry locatiuon
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_DELIVERY_LOCATION], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_LOCATION_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//Additional services
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_ADDITIONAL_CHARGES], FLOWER_ORDER_ADDITIONAL_SERVICES_X, FLOWER_ORDER_ADDITIONAL_SERVICES_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//crushed bouquet
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_CRUSHED], FLOWER_ORDER_CHECK_BOX_2_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_2_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//black roses
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_BLACK_ROSES], FLOWER_ORDER_CHECK_BOX_3_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_3_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//wilted bouquet
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_WILTED], FLOWER_ORDER_CHECK_BOX_4_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_4_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//fruit cake
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_FRUIT_CAKE], FLOWER_ORDER_CHECK_BOX_5_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_5_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//Personal sentiment
usPosX = FLOWER_ORDER_PERSONAL_SENT_TEXT_X + StringPixLength( sOrderFormText[FLORIST_ORDER_PERSONAL_SENTIMENTS], FLOWER_ORDEER_BIG_FONT) + 5;
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_PERSONAL_SENTIMENTS], FLOWER_ORDER_PERSONAL_SENT_TEXT_X, FLOWER_ORDER_PERSONAL_SENT_TEXT_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_CARD_LENGTH], usPosX, FLOWER_ORDER_PERSONAL_SENT_TEXT_Y+2, 0, FLOWER_ORDEER_TINY_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//Billing information
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_BILLING_INFO], FLOWER_ORDER_BILLING_INFO_X, FLOWER_ORDER_BILLING_INFO_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//Billing Name
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NAME], FLOWER_ORDER_NAME_TEXT_X, FLOWER_ORDER_NAME_TEXT_Y, FLOWER_ORDER_NAME_TEXT_WIDTH, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
//the text to link to the card gallery
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDER_LINK_TO_CARD_GALLERY_X, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_LINK_TO_CARD_GALLERY_X;
DrawTextToScreen(sOrderFormText[FLORIST_ORDER_STANDARDIZED_CARDS], usPosX, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDEER_LINK_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
DisplayFloristCheckBox();
//display all the things that change for the different bouquet collections
DisplayFlowerDynamicItems();
//Display the currently selected city
FlowerOrderDisplayShippingLocationCity();
MarkButtonsDirty( );
RenderWWWProgramTitleBar( );
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
void BtnFlowerOrderBackButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
btn->uiFlags |= BUTTON_CLICKED_ON;
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
{
if (btn->uiFlags & BUTTON_CLICKED_ON)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
guiCurrentLaptopMode = LAPTOP_MODE_FLORIST_FLOWER_GALLERY;
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
void BtnFlowerOrderSendButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
btn->uiFlags |= BUTTON_CLICKED_ON;
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
{
if (btn->uiFlags & BUTTON_CLICKED_ON)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
//add an entry in the finacial page for the medical deposit
AddTransactionToPlayersBook( PURCHASED_FLOWERS, 0, GetWorldTotalMin(), -(INT32)(guiFlowerPrice) );
if ( gubCurrentlySelectedFlowerLocation == 7 )
{
#ifdef JA2UB
// no UB
#else
// sent to meduna!
if ( gfFLoristCheckBox0Down )
{
HandleFlowersMeanwhileScene( 0 );
}
else
{
HandleFlowersMeanwhileScene( 1 );
}
#endif
}
//increment the order number
LaptopSaveInfo.uiFlowerOrderNumber += ( 1 + Random( 2 ) );
guiCurrentLaptopMode = LAPTOP_MODE_FLORIST;
InitFloristOrderForm();
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
void BtnFlowerOrderClearButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
btn->uiFlags |= BUTTON_CLICKED_ON;
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
{
if (btn->uiFlags & BUTTON_CLICKED_ON)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
guiCurrentLaptopMode = LAPTOP_MODE_FLORIST;
InitFloristOrderForm();
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
void BtnFlowerOrderGalleryButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
btn->uiFlags |= BUTTON_CLICKED_ON;
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
{
if (btn->uiFlags & BUTTON_CLICKED_ON)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
guiCurrentLaptopMode = LAPTOP_MODE_FLORIST_FLOWER_GALLERY;
//reset the gallery back to page 0
gubCurFlowerIndex = 0;
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
void SelectFlorsitCheckBoxRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
UINT32 uiUserData;
uiUserData = MSYS_GetRegionUserData( pRegion, 0 );
switch( uiUserData )
{
case 0:
if( gfFLoristCheckBox0Down )
{
gfFLoristCheckBox0Down = FALSE;
gfFLoristCheckBox1Down = TRUE;
}
else
{
gfFLoristCheckBox0Down = TRUE;
gfFLoristCheckBox1Down = FALSE;
}
break;
case 1:
if( gfFLoristCheckBox1Down )
{
gfFLoristCheckBox1Down = FALSE;
gfFLoristCheckBox0Down = TRUE;
}
else
{
gfFLoristCheckBox1Down = TRUE;
gfFLoristCheckBox0Down = FALSE;
}
break;
case 2:
if( gfFLoristCheckBox2Down )
gfFLoristCheckBox2Down = FALSE;
else
gfFLoristCheckBox2Down = TRUE;
break;
case 3:
if( gfFLoristCheckBox3Down )
gfFLoristCheckBox3Down = FALSE;
else
gfFLoristCheckBox3Down = TRUE;
break;
case 4:
if( gfFLoristCheckBox4Down )
gfFLoristCheckBox4Down = FALSE;
else
gfFLoristCheckBox4Down = TRUE;
break;
case 5:
if( gfFLoristCheckBox5Down )
gfFLoristCheckBox5Down = FALSE;
else
gfFLoristCheckBox5Down = TRUE;
break;
}
DisplayFloristCheckBox();
fPausedReDrawScreenFlag = TRUE;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
void DisplayFloristCheckBox()
{
HVOBJECT hPixHandle;
//check box
GetVideoObject(&hPixHandle, guiFlowerOrderCheckBoxButtonImage);
if( gfFLoristCheckBox0Down )
BltVideoObject(FRAME_BUFFER, hPixHandle, 1, FLOWER_ORDER_CHECK_BOX_0_X, FLOWER_ORDER_CHECK_BOX_0_Y, VO_BLT_SRCTRANSPARENCY,NULL);
else
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, FLOWER_ORDER_CHECK_BOX_0_X, FLOWER_ORDER_CHECK_BOX_0_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//first check box
GetVideoObject(&hPixHandle, guiFlowerOrderCheckBoxButtonImage);
if( gfFLoristCheckBox1Down )
BltVideoObject(FRAME_BUFFER, hPixHandle, 1, FLOWER_ORDER_CHECK_BOX_1_X, FLOWER_ORDER_CHECK_BOX_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
else
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, FLOWER_ORDER_CHECK_BOX_1_X, FLOWER_ORDER_CHECK_BOX_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//second check box
GetVideoObject(&hPixHandle, guiFlowerOrderCheckBoxButtonImage);
if( gfFLoristCheckBox2Down )
BltVideoObject(FRAME_BUFFER, hPixHandle, 1, FLOWER_ORDER_CHECK_BOX_2_X, FLOWER_ORDER_CHECK_BOX_2_Y, VO_BLT_SRCTRANSPARENCY,NULL);
else
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, FLOWER_ORDER_CHECK_BOX_2_X, FLOWER_ORDER_CHECK_BOX_2_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//third check box
GetVideoObject(&hPixHandle, guiFlowerOrderCheckBoxButtonImage);
if( gfFLoristCheckBox3Down )
BltVideoObject(FRAME_BUFFER, hPixHandle, 1, FLOWER_ORDER_CHECK_BOX_3_X, FLOWER_ORDER_CHECK_BOX_3_Y, VO_BLT_SRCTRANSPARENCY,NULL);
else
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, FLOWER_ORDER_CHECK_BOX_3_X, FLOWER_ORDER_CHECK_BOX_3_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//Foiurth check box
GetVideoObject(&hPixHandle, guiFlowerOrderCheckBoxButtonImage);
if( gfFLoristCheckBox4Down )
BltVideoObject(FRAME_BUFFER, hPixHandle, 1, FLOWER_ORDER_CHECK_BOX_4_X, FLOWER_ORDER_CHECK_BOX_4_Y, VO_BLT_SRCTRANSPARENCY,NULL);
else
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, FLOWER_ORDER_CHECK_BOX_4_X, FLOWER_ORDER_CHECK_BOX_4_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//fifth check box
GetVideoObject(&hPixHandle, guiFlowerOrderCheckBoxButtonImage);
if( gfFLoristCheckBox5Down )
BltVideoObject(FRAME_BUFFER, hPixHandle, 1, FLOWER_ORDER_CHECK_BOX_5_X, FLOWER_ORDER_CHECK_BOX_5_Y, VO_BLT_SRCTRANSPARENCY,NULL);
else
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, FLOWER_ORDER_CHECK_BOX_5_X, FLOWER_ORDER_CHECK_BOX_5_Y, VO_BLT_SRCTRANSPARENCY,NULL);
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
void SelectFloristCardGalleryLinkRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
guiCurrentLaptopMode = LAPTOP_MODE_FLORIST_CARD_GALLERY;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
//display the things that change on the screen
void DisplayFlowerDynamicItems()
{
UINT32 uiStartLoc=0;
UINT16 usPosX;
CHAR16 sTemp[ 640 ];
// CHAR16 sText[ 640 ];
UINT16 usPrice;
/*
//display the card saying
if( gbCurrentlySelectedCard != -1 )
{
//Get and display the card saying
//Display Flower Desc
uiStartLoc = FLOR_CARD_TEXT_TITLE_SIZE * + gbCurrentlySelectedCard;
LoadEncryptedDataFromFile( FLOR_CARD_TEXT_FILE, sTemp, uiStartLoc, FLOR_CARD_TEXT_TITLE_SIZE);
CleanOutControlCodesFromString(sTemp, sText);
DisplayWrappedString( (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_X+10), (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_Y+7), FLOWER_ORDER_PERSONAL_SENT_TEXT_WIDTH, 2, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
}
*/
//order number
usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_ORDER_NUMBER], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_ORDER_NUM_NAME_X;
swprintf(sTemp, L"%d", LaptopSaveInfo.uiFlowerOrderNumber );
DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_ORDER_NUM_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
guiFlowerPrice = 0;
// the user selected crushed bouquet
if( gfFLoristCheckBox2Down )
guiFlowerPrice += gubFlowerOrder_AdditioanalServicePrices[0];
// the user selected blak roses
if( gfFLoristCheckBox3Down )
guiFlowerPrice += gubFlowerOrder_AdditioanalServicePrices[1];
// the user selected wilted bouquet
if( gfFLoristCheckBox4Down )
guiFlowerPrice += gubFlowerOrder_AdditioanalServicePrices[2];
// the user selected fruit cake
if( gfFLoristCheckBox5Down )
guiFlowerPrice += gubFlowerOrder_AdditioanalServicePrices[3];
//price
usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_PRICE], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_BOUQUET_NAME_X;
uiStartLoc = FLOR_GALLERY_TEXT_TOTAL_SIZE * guiCurrentlySelectedFlower + FLOR_GALLERY_TEXT_TITLE_SIZE;
LoadEncryptedDataFromFile(FLOR_GALLERY_TEXT_FILE, sTemp, uiStartLoc, FLOR_GALLERY_TEXT_PRICE_SIZE);
swscanf( sTemp, L"%hu", &usPrice);
//if its the next day delivery
if( gfFLoristCheckBox0Down )
guiFlowerPrice += usPrice + FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].ubNextDayDeliveryCost;
//else its the 'when it gets there' delivery
else
guiFlowerPrice += usPrice + FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].ubWhenItGetsThereCost;
swprintf( sTemp, L"$%d.00 %s", guiFlowerPrice, pMessageStrings[ MSG_USDOLLAR_ABBREVIATION ] );
DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_BOUQUET_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
}
void SelectFloristGalleryLinkRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
guiCurrentLaptopMode = LAPTOP_MODE_FLORIST_FLOWER_GALLERY;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
void SelectFloristDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
gubFlowerDestDropDownMode = FLOWER_ORDER_DROP_DOWN_CREATE;
}
}
void SelectFloristDisableDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
gubFlowerDestDropDownMode = FLOWER_ORDER_DROP_DOWN_DESTROY;
}
}
void SelectFlowerDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
gubCurrentlySelectedFlowerLocation = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
FlowerOrderDrawSelectedCity( gubCurrentlySelectedFlowerLocation );
gubFlowerDestDropDownMode = FLOWER_ORDER_DROP_DOWN_DESTROY;
}
}
void SelectFlowerDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
{
if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
{
pRegion->uiFlags &= (~BUTTON_CLICKED_ON );
InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
}
else if( reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
{
pRegion->uiFlags |= BUTTON_CLICKED_ON ;
gubCurrentlySelectedFlowerLocation = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
FlowerOrderDrawSelectedCity( gubCurrentlySelectedFlowerLocation );
InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
}
}
BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode )
{
static UINT16 usHeight;
static BOOLEAN fMouseRegionsCreated=FALSE;
switch( ubDropDownMode )
{
case FLOWER_ORDER_DROP_DOWN_NO_ACTION:
{
}
break;
case FLOWER_ORDER_DROP_DOWN_CREATE:
{
UINT8 i;
UINT16 usPosX, usPosY;
UINT16 usTemp;
UINT16 usFontHeight = GetFontHeight( FLOWER_ORDEER_DROP_DOWN_FONT );
UINT8 ubTextFieldID;
if( fMouseRegionsCreated )
{
return(FALSE);
break;
}
//Get the current text from the text box
ubTextFieldID = (UINT8) GetActiveFieldID();
//if its the personel sentiment field
if( ubTextFieldID == 1 )
{
Get16BitStringFromField( ubTextFieldID, gsSentimentTextField, 75 );
}
else if( ubTextFieldID == 2 )
{
//else its the name field
Get16BitStringFromField( ubTextFieldID, gsNameTextField, 35 );
}
SetActiveField(0);
fMouseRegionsCreated = TRUE;
usPosX = FLOWER_ORDER_DROP_DOWN_CITY_START_X;
usPosY = FLOWER_ORDER_DROP_DOWN_CITY_START_Y;
for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++)
{
MSYS_DefineRegion( &gSelectedFlowerDropDownRegion[i], usPosX, (UINT16)(usPosY+4), (UINT16)(usPosX+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH), (UINT16)(usPosY+usFontHeight), MSYS_PRIORITY_HIGH+3,
CURSOR_WWW, SelectFlowerDropDownMovementCallBack, SelectFlowerDropDownRegionCallBack);
MSYS_AddRegion(&gSelectedFlowerDropDownRegion[i]);
MSYS_SetRegionUserData( &gSelectedFlowerDropDownRegion[ i ], 0, i);
usPosY += usFontHeight + 2;
}
usTemp = FLOWER_ORDER_DROP_DOWN_CITY_START_Y;
usHeight = usPosY - usTemp + 10;
gubFlowerDestDropDownMode = FLOWER_ORDER_DROP_DOWN_DISPLAY;
MSYS_EnableRegion(&gSelectedFloristDisableDropDownRegion);
//disable the text entry fields
// DisableAllTextFields();
Get16BitStringFromField( 1, gsSentimentTextField, 75 );
KillTextInputMode();
//disable the clear order and accept order buttons, (their rendering interferes with the drop down graphics)
}
break;
case FLOWER_ORDER_DROP_DOWN_DESTROY:
{
UINT8 i;
if( !fMouseRegionsCreated )
break;
for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++)
MSYS_RemoveRegion( &gSelectedFlowerDropDownRegion[i]);
//display the name on the title bar
ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_LOCATION_X+3, FLOWER_ORDER_DELIVERY_LOCATION_Y+3, FLOWER_ORDER_DROP_DOWN_LOCATION_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH, FLOWER_ORDER_DELIVERY_LOCATION_Y+FLOWER_ORDER_DELIVERY_LOCATION_HEIGHT-2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
DrawTextToScreen( *(FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, FLOWER_ORDER_DROP_DOWN_CITY_START_Y+3, 0, FLOWER_ORDEER_DROP_DOWN_FONT, FLOWER_ORDEER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
//enable the drop down region
MSYS_DisableRegion(&gSelectedFloristDisableDropDownRegion);
fPausedReDrawScreenFlag = TRUE;
fMouseRegionsCreated = FALSE;
gubFlowerDestDropDownMode = FLOWER_ORDER_DROP_DOWN_NO_ACTION;
//enable the text entry fields
InitFlowerOrderTextInputBoxes();
}
break;
case FLOWER_ORDER_DROP_DOWN_DISPLAY:
{
UINT8 i;
UINT16 usPosY, usPosX;
UINT16 usFontHeight = GetFontHeight( FLOWER_ORDEER_DROP_DOWN_FONT );
HVOBJECT hImageHandle;
//Display the background for the drop down window
ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_LOCATION_X, FLOWER_ORDER_DROP_DOWN_LOCATION_Y, FLOWER_ORDER_DROP_DOWN_LOCATION_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH, FLOWER_ORDER_DROP_DOWN_LOCATION_Y+usHeight, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
//
// Place the border around the background
//
GetVideoObject(&hImageHandle, guiDropDownBorder);
usPosX = usPosY = 0;
//blit top row of images
for(i=10; i< FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH-10; i+=10)
{
//TOP ROW
BltVideoObject(FRAME_BUFFER, hImageHandle, 1,i+FLOWER_ORDER_DROP_DOWN_LOCATION_X, usPosY+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//BOTTOM ROW
BltVideoObject(FRAME_BUFFER, hImageHandle, 6,i+FLOWER_ORDER_DROP_DOWN_LOCATION_X, usHeight-10+6+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
}
//blit the left and right row of images
usPosX = 0;
for(i=10; i< usHeight-10; i+=10)
{
BltVideoObject(FRAME_BUFFER, hImageHandle, 3,usPosX+FLOWER_ORDER_DROP_DOWN_LOCATION_X, i+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(FRAME_BUFFER, hImageHandle, 4,usPosX+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH-4+FLOWER_ORDER_DROP_DOWN_LOCATION_X, i+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
}
//blt the corner images for the row
//top left
BltVideoObject(FRAME_BUFFER, hImageHandle, 0, 0+FLOWER_ORDER_DROP_DOWN_LOCATION_X, usPosY+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//top right
BltVideoObject(FRAME_BUFFER, hImageHandle, 2, FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH-10+FLOWER_ORDER_DROP_DOWN_LOCATION_X, usPosY+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//bottom left
BltVideoObject(FRAME_BUFFER, hImageHandle, 5, 0+FLOWER_ORDER_DROP_DOWN_LOCATION_X, usHeight-10+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//bottom right
BltVideoObject(FRAME_BUFFER, hImageHandle, 7, FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH-10+FLOWER_ORDER_DROP_DOWN_LOCATION_X, usHeight-10+FLOWER_ORDER_DROP_DOWN_LOCATION_Y, VO_BLT_SRCTRANSPARENCY,NULL);
//Display the list of cities
usPosY = FLOWER_ORDER_DROP_DOWN_CITY_START_Y + 3;
for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++)
{
DrawTextToScreen( *(FlowerOrderLocations[i].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, usPosY, 0, FLOWER_ORDEER_DROP_DOWN_FONT, FLOWER_ORDEER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosY += usFontHeight + 2;
}
FlowerOrderDrawSelectedCity( gubCurrentlySelectedFlowerLocation );
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
break;
}
return(TRUE);
}
void FlowerOrderDrawSelectedCity( UINT8 ubNumber )
{
UINT16 usPosY;
UINT16 usFontHeight = GetFontHeight( FLOWER_ORDEER_DROP_DOWN_FONT );
usPosY = (usFontHeight + 2) * ubNumber + FLOWER_ORDER_DROP_DOWN_CITY_START_Y;
//display the name in the list
ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_CITY_START_X, usPosY+2, FLOWER_ORDER_DROP_DOWN_CITY_START_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH-9, usPosY+usFontHeight+4, Get16BPPColor( FROMRGB( 255, 255, 255 ) ) );
SetFontShadow(NO_SHADOW);
DrawTextToScreen( *(FlowerOrderLocations[ubNumber].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, (UINT16)(usPosY+3), 0, FLOWER_ORDEER_DROP_DOWN_FONT, 2, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
SetFontShadow(DEFAULT_SHADOW);
FlowerOrderDisplayShippingLocationCity();
SetFontShadow(DEFAULT_SHADOW);
}
void FlowerOrderDisplayShippingLocationCity()
{
//display the name on the title bar
ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_LOCATION_X+3, FLOWER_ORDER_DELIVERY_LOCATION_Y+3, FLOWER_ORDER_DROP_DOWN_LOCATION_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH, FLOWER_ORDER_DELIVERY_LOCATION_Y+FLOWER_ORDER_DELIVERY_LOCATION_HEIGHT-2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
DrawTextToScreen( *(FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].psCityLoc), FLOWER_ORDER_DELIVERY_LOCATION_X+5, FLOWER_ORDER_DELIVERY_LOCATION_Y+5, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
}
void InitFlowerOrderTextInputBoxes()
{
UINT32 uiStartLoc=0;
CHAR16 sTemp[ 640 ];
CHAR16 sText[ 640 ];
InitTextInputMode();
SetTextInputFont( (UINT16)FONT12ARIAL );
Set16BPPTextFieldColor( Get16BPPColor(FROMRGB( 255, 255, 255) ) );
SetBevelColors( Get16BPPColor(FROMRGB(136, 138, 135)), Get16BPPColor(FROMRGB(24, 61, 81)) );
SetTextInputRegularColors( 2, FONT_WHITE );
SetTextInputHilitedColors( FONT_WHITE, 2, 141 );
SetCursorColor( Get16BPPColor(FROMRGB(0, 0, 0) ) );
AddUserInputField( FlowerOrderUserTextFieldCallBack );
if( gbCurrentlySelectedCard != -1 )
{
//Get and display the card saying
//Display Flower Desc
uiStartLoc = FLOR_CARD_TEXT_TITLE_SIZE * + gbCurrentlySelectedCard;
LoadEncryptedDataFromFile( FLOR_CARD_TEXT_FILE, sTemp, uiStartLoc, FLOR_CARD_TEXT_TITLE_SIZE);
CleanOutControlCodesFromString(sTemp, sText);
wcsncpy( gsSentimentTextField, sText, FLOWER_ORDER_PERSONEL_SENTIMENT_NUM_CHARS - 1 );
gbCurrentlySelectedCard = -1;
}
if( wcslen( gsSentimentTextField ) >= FLOWER_ORDER_PERSONEL_SENTIMENT_NUM_CHARS - 2 )
{
gsSentimentTextField[ FLOWER_ORDER_PERSONEL_SENTIMENT_NUM_CHARS - 1] = L'\0';
}
//personal sentiment box
AddTextInputField( FLOWER_ORDER_PERSONAL_SENT_BOX_X, FLOWER_ORDER_PERSONAL_SENT_BOX_Y, FLOWER_ORDER_PERSONAL_SENT_TEXT_WIDTH, FLOWER_ORDER_PERSONAL_SENT_TEXT_HEIGHT, MSYS_PRIORITY_HIGH+2, gsSentimentTextField, FLOWER_ORDER_PERSONEL_SENTIMENT_NUM_CHARS, INPUTTYPE_ASCII );
//Name box
AddTextInputField( FLOWER_ORDER_NAME_TEXT_BOX_X, FLOWER_ORDER_NAME_TEXT_BOX_Y, FLOWER_ORDER_NAME_TEXT_BOX_WIDTH, FLOWER_ORDER_NAME_TEXT_BOX_HEIGHT, MSYS_PRIORITY_HIGH+2, gsNameTextField, FLOWER_ORDER_NAME_FIELD_NUM_CHARS, INPUTTYPE_ASCII );
}
void DestroyFlowerOrderTextInputBoxes()
{
KillTextInputMode();
}
void HandleFloristOrderKeyBoardInput()
{
InputAtom InputEvent;
while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( !HandleTextInput( &InputEvent ) && InputEvent.usEvent == KEY_DOWN )
{
UINT8 ubTextFieldID;
switch (InputEvent.usParam)
{
case ENTER:
ubTextFieldID = (UINT8) GetActiveFieldID();
//if its the personel sentiment field
if( ubTextFieldID == 1 )
{
Get16BitStringFromField( ubTextFieldID, gsSentimentTextField, 75 );
}
else if( ubTextFieldID == 2 )
{
//else its the name field
Get16BitStringFromField( ubTextFieldID, gsNameTextField, 35 );
}
SetActiveField(0);
break;
case ESC:
SetActiveField(0);
break;
default:
HandleKeyBoardShortCutsForLapTop( InputEvent.usEvent, InputEvent.usParam, InputEvent.usKeyState );
break;
}
}
}
}
void FlowerOrderUserTextFieldCallBack( UINT8 ubID, BOOLEAN fEntering )
{
if( fEntering )
{
// SetActiveField(1);
}
}
//Initialize the Florsit Order Page (reset some variables)
void InitFloristOrderForm()
{
gsSentimentTextField[0] = 0;
gfFLoristCheckBox0Down = FALSE; // next day delviery
gfFLoristCheckBox1Down = TRUE; // when it gets there delivery
gfFLoristCheckBox2Down = FALSE;
gfFLoristCheckBox3Down = FALSE;
gfFLoristCheckBox4Down = FALSE;
gfFLoristCheckBox5Down = FALSE;
guiFlowerPrice = 0;
gubCurrentlySelectedFlowerLocation = 0;
gbCurrentlySelectedCard = -1;
gsSentimentTextField[0] = 0;
gsNameTextField[0] = 0;
}